Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Order data as in IN clause

user1980Mar 16 2009 — edited Mar 16 2009
Hi,

Is there a way to order the result set to display in the same order as data supplied in IN clause

example:
select * from t_cu where cno IN (
220,
120,
900,
350,
99,
1,
34
);
I would like to display the data in the same order as
220,
120,
900,
350,
99,
1,
34
I know this can be done using UNION ALL, however if 50+ records are there in the IN clause, then it is quite a task.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 13 2009
Added on Mar 16 2009
7 comments
1,571 views