Order By Question

From: Tristan Colson <tristan_colson(at)pacbell(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Order By Question
Date: 2001-01-23 00:25:52
Message-ID: 3A6CCF90.A2A35708@pacbell.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

This seems like the answer must be pretty easy, but I can't think of it:

In the following statement:

select field1 from my_table where field2 in (3, 1, 2);

How can I modify this statement so that the record are returned in the
order of having field2 = 3, then field2 = 1, then field2 = 2.
As it stands, I am getting them returned in the order of the value of
field1.

Browse pgsql-sql by date

  From Date Subject
Next Message Tristan Colson 2001-01-23 01:01:24 Order By Question
Previous Message Jan Wieck 2001-01-22 22:19:48 Re: unreferenced primary keys: garbage collection