Re: Beginner needs help - Mailing list pgsql-sql

From Chad Thompson
Subject Re: Beginner needs help
Date
Msg-id 094f01c2e045$b9ff5980$32021aac@chad
Whole thread Raw
In response to Beginner needs help  (Aaron Chu <astrate@mac.com>)
List 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@mac.com>
To: <pgsql-sql@postgresql.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@postgresql.org so that your
> message can get through to the mailing list cleanly
>



pgsql-sql by date:

Previous
From: "Zodiac"
Date:
Subject: PL/pgSQL
Next
From: Bruno Wolff III
Date:
Subject: Re: Beginner needs help