Re: ORDER records based on parameters in IN clause - Mailing list pgsql-sql

From Greg Sabino Mullane
Subject Re: ORDER records based on parameters in IN clause
Date
Msg-id 937a483c3b3a9809ec978a24b9d9af76@biglumber.com
Whole thread Raw
In response to ORDER records based on parameters in IN clause  ("Riya Verghese" <riya.verghese@admissioncorp.com>)
Responses Re: ORDER records based on parameters in IN clause  ("Russell Simpkins" <russellsimpkins@hotmail.com>)
List pgsql-sql
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> when I say
> select * from table where id IN (2003,1342,799, 1450)
> I would like the records to be ordered as 2003, 1342, 799, 1450.

Just say:

select * from table where id IN (2003,1342,799, 1450) ORDER BY id;

If that doesn't work, you will have to be more specific and send us
the exact query.

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200506282010
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

-----BEGIN PGP SIGNATURE-----

iD8DBQFCwedPvJuQZxSWSsgRAsC0AKD2UrMtQJ6RRxbeZ8J2n68ewRt+EgCeN2UP
Qttr1dX9soeBp5HxIp+vz/c=
=cGiG
-----END PGP SIGNATURE-----




pgsql-sql by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: Re: people who buy A, also buy C, D, E
Next
From: Dawid Kuroczko
Date:
Subject: Re: ENUM like data type