Re: Beginner needs help

Поиск
Список
Период
Сортировка
От Tomasz Myrta
Тема Re: Beginner needs help
Дата
Msg-id 3E6246D7.8030804@klaster.net
обсуждение исходный текст
Ответ на Beginner needs help  (Aaron Chu <astrate@mac.com>)
Список 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.
>Thanks.

What exactly you want to do? To eliminate duplicates? Use then:
select surname from users group by surname;

Maybe you want to know which surnames are duplicated? Use then:
select surname from users group by surname having count(*)>1

Regards,
Tomasz Myrta




В списке pgsql-sql по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: default operator class (PostgreSQL's error?)
Следующее
От: "Zodiac"
Дата:
Сообщение: Re: