Search Postgresql Archives

Re: ORDER BY

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 16 Nov 2006 11:04:15 +0100, Harald Fuchs <hf1110x@xxxxxxxxxxxxxx> 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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux