I know how to use select distinct, but I would like to select "non-distinct" records, those that have duplicate values in a given field. How is that possible in SQL?
Use a group by query with a count on the field with the dups. Then select only the records with count > 1.
Something like this:
SELECT * FROM <tablename>
WHERE dupfield In (SELECT dupfield
FROM <tablename>
GROUP BY dupfield
HAVING Count(dupfield)>1);
Maq
<insert witty signature here>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.