SELECT DISTINCT ... ORDER BY UPPER(column_name) fails

Поиск
Список
Период
Сортировка
От Aymeric Levaux
Тема SELECT DISTINCT ... ORDER BY UPPER(column_name) fails
Дата
Msg-id 472DF7FE.1050504@javablackbelt.com
обсуждение исходный текст
Ответы Re: SELECT DISTINCT ... ORDER BY UPPER(column_name) fails
Список pgsql-sql
On pgsql 8.2, if you do the following query, everything is fine:

SELECT DISTINCT tag FROM logs ORDER BY tag;

But if you'd like to do a case insensitive order by like this:

SELECT DISTINCT tag FROM logs ORDER BY UPPER(tag);

or

SELECT DISTINCT tag FROM logs ORDER BY LOWER(tag);

You get the following error message :
for SELECT DISTINCT, ORDER BY expressions must appear in select list.

It is weird as the order by column appears in the select.

Any thoughts?

--
Aymeric Levaux

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