Re: Grouping by date range
От | Bruno Wolff III |
---|---|
Тема | Re: Grouping by date range |
Дата | |
Msg-id | 20030820191617.GA30279@wolff.to обсуждение исходный текст |
Ответ на | Re: Grouping by date range (Ron Johnson <ron.l.johnson@cox.net>) |
Список | pgsql-general |
On Wed, Aug 20, 2003 at 14:02:59 -0500, Ron Johnson <ron.l.johnson@cox.net> wrote: > On Wed, 2003-08-20 at 13:58, Bruno Wolff III wrote: > > On Wed, Aug 20, 2003 at 13:44:59 -0500, > > Ron Johnson <ron.l.johnson@cox.net> wrote: > > > > > > The GROUP BY does implicit sorting, so an ORDER BY on the exact same > > > column(s) as the GROUP BY is redundant. > > > > That is an implementation detail, not a promise. With hashed aggregates > > in 7.4, you might find this isn't true. > > Now that's interesting. I'd have gone to my grave thinking it was > part of the spec... I just tried something out quick and a select with group by didn't return the data in ascending order. (This is on CVS from about a week ago.) bruno=> create table temp (col int); CREATE TABLE bruno=> insert into table values (3); ERROR: syntax error at or near "table" at character 13 bruno=> insert into temp values (3); INSERT 182888 1 bruno=> insert into temp values (1); INSERT 182889 1 bruno=> insert into temp values (2); INSERT 182890 1 bruno=> analyze temp; ANALYZE bruno=> select * from temp group by col; col ----- 3 2 1 (3 rows)
В списке pgsql-general по дате отправления: