I have a table called AADETAILS with two colums ('Name' and 'ID').
The ID column is not supposed to have any duplicates, so I need a query that returns a list of all the duplicate ID's (with their Name). For example, if there is an ID with a value of 123 duplicated three times and an ID with a value of 456 duplicated four times, I need a list of the Name and ID of the three instances of 123 and the four instances of 456.
I have the following :
SELECT Name, ID
FROM AADETAILS
GROUP BY Name, ID
HAVING COUNT(ID) > 1
its not returning anything, but it should (I can see the duplicates in the table if I view all the data in it), whats wrong with that query ?
Thanks