Re: ORDER BY - Mailing list pgsql-general

From Gurjeet Singh
Subject Re: ORDER BY
Date
Msg-id 65937bea0611201905v3f5adf02r254d82cc6d26f641@mail.gmail.com
Whole thread Raw
In response to Re: ORDER BY  (Harald Fuchs <hf1110x@protecting.net>)
List pgsql-general
On 16 Nov 2006 11:04:15 +0100, Harald Fuchs <hf1110x@protecting.net> wrote:
Why so complicated?

SELECT whatever FROM foo ORDER BY name = 'Other', name

This is by far the simplest (and intelligent) of them all. And it will use a single scan of the underlying table (or index, if used), so should prove to be faster than the other UNION schemes.

Another tweak: If possible, use the integer column (ID) instead of the Name column.

Regards,

--
gurjeet[.singh]@EnterpriseDB.com
singh.gurjeet@{ gmail | hotmail | yahoo }.com

pgsql-general by date:

Previous
From: "Frank Millman"
Date:
Subject: Re: pg_get_serial_sequence is inconsistent
Next
From: "A. Kretschmer"
Date:
Subject: Re: Extract between year *and* month