Antw: duplicates

From: "Gerhard Dieringer" <DieringG(at)eba-haus(dot)de>
To: <allan(dot)kelly(at)buildstore(dot)co(dot)uk>, <pgsql-sql(at)postgresql(dot)org>
Subject: Antw: duplicates
Date: 2000-04-07 12:54:02
Message-ID: s8edf696.073@kopo001
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Allan Kelly wrote:
...
> At the moment we use this cludge:
>
> select count(*), user_name from subscribers
> group by user_name order by count;
>
>(I'm surprised I can't add 'where count > 1' but it seems conditionals on
>aggregate fields are not allowed).

Try select count(*), user_name from subscribers
group by user_name having count(*) > 1;

Gerhard

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Varga 2000-04-07 12:54:32 subquery returnig more than one field
Previous Message Moray McConnachie 2000-04-07 12:05:05 Re: duplicates