Re: BUG #1555: bug in GROUP BY?

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: BUG #1555: bug in GROUP BY?
Дата
Msg-id 20050327062249.GA45629@winnie.fuhr.org
обсуждение исходный текст
Ответ на BUG #1555: bug in GROUP BY?  ("Peter Cottingham" <cottingh@rci.rutgers.edu>)
Ответы Re: BUG #1555: bug in GROUP BY?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Mon, Mar 21, 2005 at 07:20:04PM +0000, Peter Cottingham wrote:
>
> Appears that the GROUP BY clause is not working correctly on new server
> (GROUP BY should order the result set in ASCENDING order, NOT DESCENDING
> order.)  See below
>
> **********************************
> select dom_id, count(ste_id) as ste_count
> from ste
> group by dom_id
> **********************************

As far as I know, the SQL standards don't specify that GROUP BY is
supposed to give a particular order.  A query without an ORDER BY
clause, or a query with an ORDER BY clause that isn't specific
enough, has an order that's implementation-dependent.  If you want
a particular order then use ORDER BY.

Somebody please correct me if I'm mistaken (with a relevant citation
from one of the standards).

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

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

Предыдущее
От: Robert Creager
Дата:
Сообщение: Re: BUG #1563: wrong week returnded by date_trunc('week',
Следующее
От: "Matthew T. O'Connor"
Дата:
Сообщение: Re: BUG #1567: can't hide password with pg_autovacuum