I have a table having multiple columns, the two named are ID and email, Now i what i want to do is that i want the values of ID's for those Columns having same email address or duplicate email address. Suppose we have the following table named "Table1" having two fields ID and Email and having following Data.
Use the following SQL Query to get ID's having Duplicate Email address
Select ID from Table1 where Name IN (SELECT Name FROM Table1 GROUP BY Name HAVING ( COUNT(Name) > 1 ))
Now this Query will return 1,3,5,7,10,12,4 and 6 from the above table having same Data.