Re: Beginner needs help

Поиск
Список
Период
Сортировка
От Björn Lundin
Тема Re: Beginner needs help
Дата
Msg-id b4dtl8$1ejl$1@news.hub.org
обсуждение исходный текст
Ответ на 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.

select surname, count('a') from table
group by surname
having count('a') > 1
order by surname

/Björn 


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

Предыдущее
От: Rupa Schomaker
Дата:
Сообщение: Re: Special characters in SQL queries
Следующее
От: Kim Petersen
Дата:
Сообщение: problematic query (for me ;-)