Re: ORDER BY - Mailing list pgsql-general

From Niklas Johansson
Subject Re: ORDER BY
Date
Msg-id AC298A15-7BCA-432A-B304-2049E9316A19@tele2.se
Whole thread Raw
In response to ORDER BY  ("MicroUser" <a.shafar@gmail.com>)
Responses Re: ORDER BY  (Brent Wood <b.wood@niwa.co.nz>)
List pgsql-general
On 14 nov 2006, at 23.03, MicroUser wrote:
> I need sorted result but the way like this:
>
> 0 | Anna
> 3 | Fernando
> 2 | Link
> 1 | Other
>
> Record '1 | Other' must by at the end of query result.
>
> How I can get it?


Well, maybe not the answer you're looking for, but a rather clean way
to do this would be to only store actual names in the table, let your
application do the select and sort, and then add the 'Other' at runtime.

If the 'Other' needs to be stored, perhaps it could be represented
with a NULL value instead? (It's not really a name, just a
placeholder for not knowing, isn't it?)


Sincerely,

Niklas Johansson
Phone: +46-322-108 18
Mobile: +46-708-55 86 90




pgsql-general by date:

Previous
From: Marcus Engene
Date:
Subject: Re: Discover temporary INDEX/TABLE name
Next
From: Jerry Sievers
Date:
Subject: Re: Discover temporary INDEX/TABLE name