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

Поиск
Список
Период
Сортировка
От Thomas G. Lockhart
Тема Re: [HACKERS] No: implied sort with group by
Дата
Msg-id 34CFF41C.2C5D9B1E@alumni.caltech.edu
обсуждение исходный текст
Ответ на Re: [HACKERS] No: implied sort with group by  (darrenk@insightdist.com (Darren King))
Список pgsql-hackers
> > postgres=> select b,c,sum(a) from t1 group by b,c;
> > b|c|sum
> > -+-+---
> >  |x|  5
> >  |z|  3
> >  |x|  0
> > (3 rows)
> >
> > postgres=> select * from t1;
> > a|b|c
> > -+-+-
> > 1| |x
> > 2| |x
> > 2| |x
> > 3| |z
> > 0| |x
> > (5 rows)
> >
> > I just inserted a single out-of-order row at the end of the table which, since the
> > integer value is zero, should have not affected the result. Sorry I didn't understand
> > the nature of the test case.

> Hmmm...is this a grouping problem or an aggregate problem?  Or both?  The first
> query above should have the data sorted before aggregating, shouldn't it, or I
> am still missing a piece of this puzzle?

fwiw, I see the same incorrect behavior in v6.2.1p5.

                                                - Tom


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

Предыдущее
От: The Hermit Hacker
Дата:
Сообщение: Re: [HACKERS] postmaster crash and .s.pgsql file
Следующее
От: Bruce Momjian
Дата:
Сообщение: 6.3 CHANGES list