Re: DISTINCT and COUNT help

Поиск
Список
Период
Сортировка
От Chris
Тема Re: DISTINCT and COUNT help
Дата
Msg-id 5.1.0.14.0.20020628151949.027f1d70@cooee.cybersydney.com.au
обсуждение исходный текст
Ответ на DISTINCT and COUNT help  (Julie Keywell <julie@iparenting.com>)
Список pgsql-novice
Hi Julie,

>I would like to count the number of distinct values in a column.  Is
>there any way to combine DISTINCT and COUNT and if so, what is the
>syntax?

Sure is.

SELECT DISTINCT column, COUNT(column) FROM table GROUP BY column;

HTH,

-----------------
      Chris Smith
http://www.squiz.net/




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

Предыдущее
От: Julie Keywell
Дата:
Сообщение: DISTINCT and COUNT help
Следующее
От: Manfred Koizar
Дата:
Сообщение: Re: DISTINCT and COUNT help