Re: Beginner needs help

Поиск
Список
Период
Сортировка
От Victor Yegorov
Тема Re: Beginner needs help
Дата
Msg-id 20030301084126.GB9377@pirmabanka.lv
обсуждение исходный текст
Ответ на Beginner needs help  (Aaron Chu <astrate@mac.com>)
Список 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 по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Beginner needs help
Следующее
От: "Victor Yegorov"
Дата:
Сообщение: Re: use of geometric types in select ?