Re: Beginner needs help - Mailing list pgsql-sql

From Victor Yegorov
Subject Re: Beginner needs help
Date
Msg-id 20030301084126.GB9377@pirmabanka.lv
Whole thread Raw
In response to Beginner needs help  (Aaron Chu <astrate@mac.com>)
List pgsql-sql
* Aaron Chu <astrate@mac.com> [01.03.2003 03:22]:
> 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.

Say you have such a table:
create table person (   name    varchar(10) not null,   surname varchar(20) not null
);
Now your select:
selectsurname
fromperson
group by surname
having count(surname) > 1;

--

Victor Yegorov

pgsql-sql by date:

Previous
From: Greg Stark
Date:
Subject: Re: Beginner needs help
Next
From: "Victor Yegorov"
Date:
Subject: Re: use of geometric types in select ?