Re: SELECT DISTINCT ... ORDER BY UPPER(column_name) fails - Mailing list pgsql-sql

From Tom Lane
Subject Re: SELECT DISTINCT ... ORDER BY UPPER(column_name) fails
Date
Msg-id 15015.1194196351@sss.pgh.pa.us
Whole thread Raw
In response to SELECT DISTINCT ... ORDER BY UPPER(column_name) fails  (Aymeric Levaux <aymeric@javablackbelt.com>)
List pgsql-sql
Aymeric Levaux <aymeric@javablackbelt.com> writes:
> SELECT DISTINCT tag FROM logs ORDER BY UPPER(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.

No it doesn't.  The ORDER BY expression is "UPPER(tag)" not just "tag".
        regards, tom lane


pgsql-sql by date:

Previous
From: Aymeric Levaux
Date:
Subject: SELECT DISTINCT ... ORDER BY UPPER(column_name) fails
Next
From: Volkan YAZICI
Date:
Subject: Partitioning and Foreign Keys