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

duplicate check on multiple col in sql server 2000

Status
Not open for further replies.

spaliwal

Programmer
Dec 28, 2001
31
0
0
IN
Hi,

Pl. anybody suggest me sql query to select duplicates on combination of multiple columns say columns A, B, C, D of table MyTab .

Thanks,

Shailesh

 
This will return you all the duplicates in MyTab based on the columns A,B,C,D.

SELECT COUNT(*), columnA, columnB, columnC, columnD
FROM MyTab
GROUP BY columnA, columnB, columnC, columnD
HAVING COUNT(*) > 1
ORDER BY columnA

Steve Mac
 
Hi Steve,

Thanks a lot, it worked and solved my problem.

Thanks again,

Shailesh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top