Here is a sample. I want the table to be sorted on the input parameters (20,40,30,10).
Drop table dummy;
create table dummy(aname varchar2(20)
,acode number(4,0));
insert into dummy(aname,acode) values ('Wyoming',30);
insert into dummy(aname,acode) values ('Texas',10);
insert into dummy(aname,acode) values ('Iowa',40);
insert into dummy(aname,acode) values ('Kansas',20);
commit;
Select acode, aname
from dummy
where acode in (20,40,30,10);
I want the output to be sorted by the (20,40,30,10) - this input could have more numbers than these 4 and look like this:
20, Kansas
40, Iowa
30, Wyoming
10, Texas
Suggestions?
TIA
Shall42