Re: Beginner needs help

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Beginner needs help
Дата
Msg-id 873cm7mwr4.fsf@stark.dyndns.tv
обсуждение исходный текст
Ответ на Beginner needs help  (Aaron Chu <astrate@mac.com>)
Список pgsql-sql
Aaron Chu <astrate@mac.com> writes:

> 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 FROM table GROUP BY surname HAVING count(*) > 1

More generally, read up on GROUP BY.

-- 
greg



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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Executing SQL commands via triggers without the use of
Следующее
От: "Victor Yegorov"
Дата:
Сообщение: Re: Beginner needs help