Which query would you use to display duplicate records into the table ? 😇 😇 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Which query would you use to display duplicate records into the table ? 😇 😇

Comment your mind answer 😇

22nd Jan 2017, 6:33 PM
Jenny Lance
Jenny Lance - avatar
7 Answers
+ 6
display it..
22nd Jan 2017, 6:36 PM
Jenny Lance
Jenny Lance - avatar
+ 3
i think something like this should work: SELECT a.*, b.totalCount AS Duplicate FROM tablename a INNER JOIN ( SELECT email, COUNT(*) totalCount FROM tableName GROUP BY email ) b ON a.email = b.email WHERE b.totalCount >= 2
23rd Jan 2017, 12:11 AM
R4xx4r
R4xx4r - avatar
+ 2
You want to get rid of duplicates? Or find them and display them?
22nd Jan 2017, 6:36 PM
Sam
+ 2
you could make a condition with COUNT()
22nd Jan 2017, 6:40 PM
Sam
+ 2
maybe like this? select * from employee where count(id)>1
22nd Jan 2017, 8:10 PM
Agustinus Kevin
0
Use max rowid with group by columns....
26th Feb 2017, 10:54 AM
Ashish Shakya