problem to count (distinct number)

Поиск
Список
Период
Сортировка
От Mikael Hedin
Тема problem to count (distinct number)
Дата
Msg-id 8766jemb21.fsf@zodiac.irf.se
обсуждение исходный текст
Ответы Re: problem to count (distinct number)  (Jie Liang <jliang@ipinc.com>)
Re: problem to count (distinct number)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: problem to count (distinct number)  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-sql
Hi,

I have a table with a column (int4), and I want to know how many
different numbers there are.  In an example book I saw the query

SELECT COUNT (DISTINCT data ) FROM media;

by then I get 

ERROR:  parser: parse error at or near "distinct"

Is the query in error or does PostgreSQL not support this?  How do I
then get the number of distinct data from my table?

TIA,

Micce 


-- 
Mikael Hedin, MSc                   +46 (0)980 79176
Swedish Institute of Space Physics  +46 (0)8 344979 (home)
S-Box 812, 981 28 KIRUNA, Sweden    +46 (0)70 5891533 (mobile)



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

Предыдущее
От: Josh Berkus
Дата:
Сообщение: Re: Selecting Current value from a sequence
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Selecting Current value from a sequence