Re: Sql - I have a table with duplicate names in it. Write me a query which returns only duplicate rows with number of times they are repeated.
SELECT ID,COUNT(*) FROM EMP2 E WHERE ROWID >(SELECT MIN(ROWID) FROM EMP2 R WHERE E.ID=R.ID)GROUP BY E.ID
IF U HAVE BELOW TABLE
EMP
ID
10
10
20
20
20
|