View Single Post
Old 19-09-08, 03:05 PM   #3 (permalink)
TILAK
Junior Member
 
Join Date: Sep 2008
Age: 24
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 1 TILAK is on a distinguished road
Thumbs up 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
TILAK is offline   Reply With Quote