Re: how to find duplicates key

Lists: pgsql-novice
From: Christian Valverde <valval(at)porta(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: how to find duplicates key
Date: 2003-09-15 20:01:05
Message-ID: 200309151501.05131.valval@porta.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

how do i find a duplicate key so i can make a unique index


From: Heath Tanner <heath(at)inligo(dot)com>
To: valval(at)porta(dot)net
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: how to find duplicates key
Date: 2003-09-15 20:37:26
Message-ID: 6ABD3730-E7BC-11D7-8C53-0003930C11A0@inligo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

On Monday, September 15, 2003, at 04:01 PM, Christian Valverde wrote:

> how do i find a duplicate key so i can make a unique index

SELECT my_key, count(*) FROM my_table GROUP BY my_key HAVING count(*) >
1;

-heath