on-internet
← Community

Returning multiple columns and count of duplicates with GROUP BY clause

Stack Overflow ·

I'm searching for duplicate values per column and need a count of them and data from some additional columns. Table sample BillNr Name email 1000 Shakira [email protected] 1001 Shakira [email protected] 1002 Shakira [email protected] 2220 Beyonce [email protected] 2221 Beyonce [email protected] 3330 Rihanna [email protected] 3331 RiRi [email protected] 7000 ImNotDbl [email protected] 7777 MeNeither [email protected] 8000 HumptyDumpty [email protected] 9999 NotDblTrbl [email protected] 9999 WhyAreWeAllNotSingle [email protected] This returns the correct result: SELECT Name, email, COUNT(email) FROM table GROUP BY Name, email HAVING COUNT(emai

Comments

Sign in or sign up to comment and upvote.

No comments yet.