Feb 26, 2002 #1 spaliwal Programmer Dec 28, 2001 31 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
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
Feb 27, 2002 #2 SteveMac32 Programmer Jan 25, 2002 74 GB 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 Upvote 0 Downvote
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
Feb 28, 2002 Thread starter #3 spaliwal Programmer Dec 28, 2001 31 IN Hi Steve, Thanks a lot, it worked and solved my problem. Thanks again, Shailesh Upvote 0 Downvote