Search Postgresql Archives

Re: ORDER BY 'DK', 'DE', DESC?

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

 



On Tue, 11 May 2004, [ISO-8859-1] Victor Spång Arthursson wrote:

> Hi!
>
> I would like to know if it's possible to give a priority order of how
> to sort the returning rows?
>
> Like for example to order every row with a field language = DK first,
> then the rows with field language = *DE' and last the other languages,
> ordered alphabetically…?

Well, I think you can do something like:

ORDER BY (language = 'DK'), (language = 'DE'), language

(or you could possibly condense the first two into one with case)

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org


[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