Coding for "Not Distinct"

  • 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 ?

  • 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

    )

  • 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