From: Tom Lane <tgl@sss.pgh.pa.us>
To: aymeric@javablackbelt.com
Cc: pgsql-sql@postgresql.org
Subject: Re: SELECT DISTINCT ... ORDER BY UPPER(column_name) fails
Date: Sun, 04 Nov 2007 12:12:31 -0500
Message-ID: <15015.1194196351@sss.pgh.pa.us> (raw)
In-Reply-To: <472DF7FE.1050504@javablackbelt.com>
References: <472DF7FE.1050504@javablackbelt.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, aymeric@javablackbelt.com
Subject: Re: SELECT DISTINCT ... ORDER BY UPPER(column_name) fails
In-Reply-To: <15015.1194196351@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox