Re: ORDER BY

From: Niklas Johansson <spot(at)tele2(dot)se>
To: MicroUser <a(dot)shafar(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ORDER BY
Date: 2006-11-15 20:52:31
Message-ID: AC298A15-7BCA-432A-B304-2049E9316A19@tele2.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

  • ORDER BY at 2006-11-14 22:03:40 from MicroUser

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jerry Sievers 2006-11-15 21:11:16 Re: Discover temporary INDEX/TABLE name
Previous Message Marcus Engene 2006-11-15 20:50:10 Re: Discover temporary INDEX/TABLE name