Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> displaying result sets in the order listed in the IN list

displaying result sets in the order listed in the IN list

From: Ivan Chow <ichow2_at_hotmail.com>
Date: Fri, 16 Apr 2004 13:34:42 -0400
Message-ID: <BAY12-F73q9TvLOrDWS0004f539@hotmail.com>


Hello,
I have a table that has the following values:

select * from mytab;

mycol



1
2
3
4
5
6

select * from mytab where mycol in (3,1,4);

mycol



1
3
4

Is it possible to display the values of mycol in the order the literal values are listed in the IN list? The IN list string 3,1,4 is passed in by another program and it can be listed in any order. I need the results to be display in whatever the order is in the IN list.

My expected result is

mycol



3
1
4

Is that possible? If not, any suggestions?

thanks in advance.

Ivan C.



Stop worrying about overloading your inbox - get MSN Hotmail Extra Storage! http://join.msn.com/?pgmarket=en-us&page=hotmail/es2&ST=1/go/onm00200362ave/direct/01/

Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html

-----------------------------------------------------------------
Received on Fri Apr 16 2004 - 12:31:07 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US