Order by... of "IN" condition
499841Dec 5 2006 — edited Dec 6 2006Hi,
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