Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DISTINCTROW in DELETE .... and SELECT, UPDATE etc.

Status
Not open for further replies.

Solomons

Programmer
Jan 29, 2003
22
US
Hi All,
I'm working on porting an Access 97 Database to SQL Server. The front end will still remain in Access but the data will be moving to SQL server. There's the background now I'm having a little problem understanding DISTINCTROW.
I know that in a select statement it gives me ROWS that are unique (correct me if i'm wrong here). But what exactly does it do if I have multiple tables and joins.
I see some queries like

DELETE DISTINCTROW Pet.PetId, TempPetdata.PetId, Pet.* FROM Pet LEFT JOIN TempPetdata ON Pet.PetId = TempPetdata.[clock#] WHERE (((TempPetdata.[clock#]) Is Not Null))

This seems to delete the join'ed rows from Pet table. I cant figure out why put the field names of the TempPetData in the Delete part at all? Any ideas?
Also, When Joins are used, in select, update or delete, does distinct row behave as a normal DISTINCT?

Thanx Solomons

Pet is a table with details of all the pets. TempPetData is just a temp table created of all the pets that are no longer sold.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top