Re: query for non-unique values?

From: snpe <snpe(at)snpe(dot)co(dot)yu>
To: "Andy Kriger" <akriger(at)greaterthanone(dot)com>, "Pgsql-General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: query for non-unique values?
Date: 2002-09-24 13:04:38
Message-ID: 200209241504.38267.snpe@snpe.co.yu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

select dup_columns,count((*)
from table
group by dup_columns
having count(*) > 1

On Monday 23 September 2002 11:46 pm, Andy Kriger wrote:
> I have a file of legacy data that has duplicate entries in a column that
> I'd like to have a unique index on. How can I query to find the duplicates
> (so I can determine if they can be thrown out)?
>
> thx
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-09-24 13:26:25 Re: [GENERAL] CURRENT_TIMESTAMP
Previous Message Tourtounis Sotiris 2002-09-24 12:56:25 Number of disk pages obtained by explain analyze