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 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply