DISTINCT ordering

From: Jake Stride <nsuk(at)users(dot)sourceforge(dot)net>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: DISTINCT ordering
Date: 2004-08-10 11:24:05
Message-ID: BD3E6EE5.184F%nsuk@users.sourceforge.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I have a view from which I select values, but I need to do a 'SELECT
DISTINCT' query on a 'varchar' column and order by lower case eg:

SELECT DISTINCT name FROM someview ORDER BY lower(name)

Obviously this doesn't work with the 'DISTINCT' but is there any way to do
it apart from:

SELECT v.name FROM (SELECT DISTINCT name FROM someview) v ORDER BY
lower(v.name)

Or is this the most efficient way?

Thanks

Jake

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Marcel Boscher 2004-08-10 12:44:52 Syntax Error
Previous Message Roberto Rezende de Assis 2004-08-10 10:43:29 SOUNDEX