Re: Counting distinct names

Поиск
Список
Период
Сортировка
От Brett W. McCoy
Тема Re: Counting distinct names
Дата
Msg-id Pine.LNX.4.10.10004172202030.6329-100000@chapelperilous.net
обсуждение исходный текст
Ответ на Counting distinct names  ("G. Anthony Reina" <reina@nsi.edu>)
Список pgsql-sql
On Mon, 17 Apr 2000, G. Anthony Reina wrote:

> Let's say I have a table:
> 
> table1
> =====
> 
> subject_name         text
> subject_age            int4
> test_trial                int4
> test_score               int4
> 
> 
> I'd like to find out how many times a unique 'subject_name' is in the
> table. My SQL book says that I should be able to do this:
> 
> select COUNT(DISTINCT subject_name) from table1;

SELECT DISTINCT(subject_name), COUNT(subject_name) 
FROM table1 
GROUP BY subject_name
;

Brett W. McCoy                                                                     http://www.chapelperilous.net
---------------------------------------------------------------------------
Anything that is good and useful is made of chocolate.



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

Предыдущее
От: "G. Anthony Reina"
Дата:
Сообщение: Counting distinct names
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Counting distinct names