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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete duplicate records based on two distinct fields

Status
Not open for further replies.

naitx

Programmer
Apr 18, 2008
10
PH
I have a table called Products with fields ProductID,ProductName,ProductLevel,Description.


ProductName ProductID ProductLevel Description
ProdA A1 level1 blah...
ProdA A1 level1 blah...
ProdC A2 level2 blah..
ProdD A3 level3 blah..
ProdD A3 level3 blah...
ProdE A4 level3 blah...
ProdE A4 level2 blah...

what I want is an sql query that delete duplicate records based on distinct ProductID and ProductLevel fields,the result will be something like this..

ProductName ProductID ProductLevel Description
ProdA A1 level1 blah...
ProdC A2 level2 blah..
ProdD A3 level3 blah..
ProdE A4 level3 blah...
ProdE A4 level2 blah...

btw,no PK

Thanks in Advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top