pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
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



view thread (2+ messages)

Message-ID: <15015.1194196351@sss.pgh.pa.us>
Permalink:  ../15015.1194196351@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15015.1194196351@sss.pgh.pa.us

 · 

reply

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