Re: Beginner needs help

From: Björn Lundin <bjorn(dot)lundin(dot)no(dot)spam(at)swipnet(dot)se>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Beginner needs help
Date: 2003-03-08 23:20:57
Message-ID: b4dtl8$1ejl$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Aaron Chu 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, count('a') from table
group by surname
having count('a') > 1
order by surname

/Björn

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message daniel alvarez 2003-03-08 23:21:37 Re: Atomicity of UPDATE, interchanging values in unique
Previous Message jasiek 2003-03-08 22:27:13 Re: Cancelling Queries