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

Поиск
Список
Период
Сортировка
От Manfred Koizar
Тема Re: What's wrong with this group by clause?
Дата
Msg-id fhb37vsiacbvl4u9tqai03p806p28q3rej@4ax.com
обсуждение исходный текст
Ответ на Re: What's wrong with this group by clause?  ("Len Morgan" <len-morgan@crcom.net>)
Список pgsql-sql
On Thu, 13 Mar 2003 01:34:34 -0600, "Len Morgan"
<len-morgan@crcom.net> wrote:
>>GROUP BY
> >  field1,
>  > field2,
>  >name;
>I think the problem is that you don't have a column to group on.

field1, field2, and name are the grouping columns.

>Try adding
>SELECT ....,count(*).... so that there is an aggregate of some kind.

You don't need an aggregate in a GROUP BY query.  A SELECT ... GROUP
BY without any aggregate behaves like SELECT DISTINCT.  There's
nothing wrong with it.  Performance might be a different story.

BTW, Franco's problem has been recognised as a bug and a patch has
already been published (cf. Tom Lane's mail in this thread).

ServusManfred


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

Предыдущее
От: dev@archonet.com
Дата:
Сообщение: Re: Poor performance on a right join
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: View - Join based on dis-similar data types