pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tristan Colson <tristan_colson@pacbell.net>
To: pgsql-sql@postgresql.org
Subject: Order By Question
Date: Mon, 22 Jan 2001 17:01:24 -0800
Message-ID: <3A6CD7E4.8BE6DDC3@pacbell.net> (raw)

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 first those records 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.




view thread (15+ messages)  latest in thread

Message-ID: <3A6CD7E4.8BE6DDC3@pacbell.net>
Permalink:  ../3A6CD7E4.8BE6DDC3@pacbell.net/
Also on:    postgresql.org/message-id/3A6CD7E4.8BE6DDC3@pacbell.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tristan_colson@pacbell.net
  Subject: Re: Order By Question
  In-Reply-To: <3A6CD7E4.8BE6DDC3@pacbell.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox