Re: Beginner needs help

From: "Chad Thompson" <chad(at)weblinkservices(dot)com>
To: "Aaron Chu" <astrate(at)mac(dot)com>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Beginner needs help
Date: 2003-03-01 22:55:57
Message-ID: 094f01c2e045$b9ff5980$32021aac@chad
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

So, if I understand. You want a list of people whose surnames appear more
than once?

Something like

select count(*), surname
from mytable
group by surname
having count(*) > 1

This will show a unique list of all the surnames that appear more than 1
time.

HTH
Chad
----- Original Message -----
From: "Aaron Chu" <astrate(at)mac(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Sent: Thursday, February 27, 2003 4:17 PM
Subject: [SQL] Beginner needs help

> 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.
>
> Thanks.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Zodiac 2003-03-01 22:57:14 PL/pgSQL
Previous Message Nicolas Fertig 2003-03-01 18:53:27 OUTER JOIN with filter