February 21, 2002 at 2:19 pm
I would like to run a simple query to identify duplicate records in a table, in other words, something like a NOT DISTINCT keyword would be perfect. Any ideas ?
February 21, 2002 at 2:29 pm
If there is a main field you would want to know this on the something like this
SELECT fldIwannaC
FROM myTbl
GROUP BY fldIwannaC
HAVING COUNT(fldIwannaC) > 1
If you want to see the entire row then there are a few ways include listing all the rows in the group by clause in the above or
SELECT *
FROM myTbl
WHERE fldIwannaC IN (
SELECT fldIwannaC
FROM myTbl
GROUP BY fldIwannaC
HAVING COUNT(fldIwannaC) > 1
)
February 22, 2002 at 1:02 pm
Thanks for the help !
If there is a main field you would want to know this on the something like this
SELECT fldIwannaC
FROM myTbl
GROUP BY fldIwannaC
HAVING COUNT(fldIwannaC) > 1
If you want to see the entire row then there are a few ways include listing all the rows in the group by clause in the above or
SELECT *
FROM myTbl
WHERE fldIwannaC IN (
SELECT fldIwannaC
FROM myTbl
GROUP BY fldIwannaC
HAVING COUNT(fldIwannaC) > 1
)
[/quote]
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy