Click to See Complete Forum and Search --> : Comparing values with a single query


amrigo
07-16-2009, 02:23 PM
Hi

Using mysql is there any query we can build to compare values in a collumn to see if there is no duplicated values.

A query like somecollumn .. not unique ... and this query returns all the lines with duplicated values to a given collumn?

Thank´s in advance

sknake
07-16-2009, 04:37 PM
select primaryKey, count(*) as cnt
from table
group by primaryKey
having cnt > 1