Re: Beginner needs help

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Aaron Chu <astrate(at)mac(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Beginner needs help
Date: 2003-03-02 00:23:48
Message-ID: 20030302002348.GA16937@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, Feb 27, 2003 at 23:17:06 +0000,
Aaron Chu <astrate(at)mac(dot)com> wrote:
> Hi,
>
> I have a table which has a column of surnames (string) and I would like
> to know how can I retrieve (SELECT) all the repeated surnames, i.e.
> more than one person who has the same surname.

select surname from whatevertable group by surname having count(*) > 1
order by surname;

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Denis Zaitsev 2003-03-02 00:40:33 Re: Are scalar type's in/out functions implicitly STRICT?
Previous Message Zodiac 2003-03-01 22:57:14 PL/pgSQL