Re: "for SELECT DISTINCT, ORDER BY expressions must appear in select list" - is that the standart or a limitation of postgresql?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: "for SELECT DISTINCT, ORDER BY expressions must appear in select list" - is that the standart or a limitation of postgresql?
Дата
Msg-id 45D46196.2090003@archonet.com
обсуждение исходный текст
Ответ на "for SELECT DISTINCT, ORDER BY expressions must appear in select list" - is that the standart or a limitation of postgresql?  ("Walter Cruz" <walter.php@gmail.com>)
Ответы Re: "for SELECT DISTINCT, ORDER BY expressions must appear in select list" - is that the standart or a limitation of postgresql?  (Michael Glaesemann <grzm@seespotcode.net>)
Список pgsql-sql
Walter Cruz wrote:
> 
> SELECT distinct name from test order by number
> 
> (well, I think that que query doesn't make any sense, but raises the 
> error :) )
> 
> The error: ERROR:  for SELECT DISTINCT, ORDER BY expressions must
> appear in select list is due to a standart implementarion or a design
> decision of postgres?

I think ORDER BY is defined to take place after DISTINCT, which means 
there is no meaningful "number" for it to order by. You could 
arbitrarily choose the first number encountered, but I can't see what 
sense it would make to order by them.

--   Richard Huxton  Archonet Ltd


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

Предыдущее
От: "Walter Cruz"
Дата:
Сообщение: "for SELECT DISTINCT, ORDER BY expressions must appear in select list" - is that the standart or a limitation of postgresql?
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: "for SELECT DISTINCT, ORDER BY expressions must appear in select list" - is that the standart or a limitation of postgresql?