Re: What's wrong with this group by clause?

Поиск
Список
Период
Сортировка
От Len Morgan
Тема Re: What's wrong with this group by clause?
Дата
Msg-id 00a201c2e932$fee5b9e0$0300a8c0@kttk.net
обсуждение исходный текст
Ответ на What's wrong with this group by clause?  (Franco Bruno Borghesi <franco@akyasociados.com.ar>)
Ответы Re: What's wrong with this group by clause?  (Manfred Koizar <mkoi-pg@aon.at>)
Список pgsql-sql
From: Franco Bruno Borghesi <franco@akyasociados.com.ar>
>SELECT>  0 AS field1, > 0 AS field2,  >name
>FROM>  people
>GROUP BY>  field1, > field2, >name;

I think the problem is that you don't have a column to group on.  Try adding
SELECT ....,count(*).... so that there is an aggregate of some kind.
Alternatively, you could use DISTINCT ON (field1,field2) field1,field2,name
FROM ...  although this is a Postgres specific extension of the SQL spec.

Len Morgan




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

Предыдущее
От: "Ian Harding"
Дата:
Сообщение: Re: Create function statement with insert statement
Следующее
От: Larry Rosenman
Дата:
Сообщение: Re: nearest match