order by <something wierd>

From: Mathieu Arnold <mat(at)mat(dot)cc>
To: pgsql-sql(at)postgresql(dot)org
Subject: order by <something wierd>
Date: 2002-05-14 11:49:41
Message-ID: 1713675304.1021384181@andromede.reaumur.absolight.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi

I have :

table a (int, varchar, int)

1 | one | 1
2 | two | 3
3 | three | 2
4 | four | 3
5 | five | 2

And I would like to select it and sort it so that the 3rd field is first 2,
then 1 and then 3. so that the result should be :

1 | one | 1
3 | three | 2
5 | five | 2
2 | two | 3
4 | four | 3

How could I do that ?

--
Mathieu Arnold

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Marin Dimitrov 2002-05-14 12:01:55 Re: order by <something wierd>
Previous Message juerg.rietmann 2002-05-14 09:29:01 date_part, how to use