Re: [HACKERS] No: implied sort with group by

Поиск
Список
Период
Сортировка
От Thomas G. Lockhart
Тема Re: [HACKERS] No: implied sort with group by
Дата
Msg-id 34CE0F07.4ADAF81@alumni.caltech.edu
обсуждение исходный текст
Ответ на Re: [HACKERS] No: implied sort with group by  (darrenk@insightdist.com (Darren King))
Ответы Re: [HACKERS] No: implied sort with group by  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-hackers
> > > Does the SQL standard say anything about an implied sort when
> > > grouping or is it up to the user to include an ORDER BY clause?

Up to the user. SQL is a set-oriented language. The fact that many/most/all
implementations order results to then do grouping is an implementation
detail, not a language definition.


> This is what I think is missing or broken right now.
>
> > > select * from t1;
> >          a b  c
> >          1    x
> >          2    x
> >          3    z
> >          2    x
> >
> > 4 row(s) retrieved.
> > > select b,c,sum(a) from t1 group by b,c;
> > b  c             (sum)
> >
> >    x                 5
> >    z                 3
> >> 2 row(s) retrieved.

Sorry, I've lost the thread. What is broken? I get this same result, and
(assuming that column "b" is full of nulls) I think this the correct result.

                                                        - Tom


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

Предыдущее
От: Andrew Martin
Дата:
Сообщение: Re: Re: [PORTS] the 'money' type
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] No: implied sort with group by