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 by... of "IN" condition

499841Dec 5 2006 — edited Dec 6 2006
Hi,
I have this problem
The table AVVISI has two fiels

CODI_AVVI number (5)
DESC_AVVI varchar2(2000)

and contains for example 1000 records, where codi_avvi is unique.


I must select from a table AVVISI, only the records that have the field CODI_AVVI with this values
10,3,2,5,1,6,3
and order by like the sequence of the "IN" (that I have in a variable)

For example

select codi_avvi,desc_avvi
from avvisi
where codi_avvi in (10,3,2,5,1,6,3)

the result must be

CodiAvvi Desc_avvi
10 XXXX
3 YYYY
2 ZZZ

etc...
3 WWW (the last record)



It's possibile and how I can?

thank's for help
Paolo
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 3 2007
Added on Dec 5 2006
5 comments
363 views