URGENT HELP:I want that the query should return in the same way

I have a query
select id from tableid where id in(350,241,251)
This returns me in
241,251,350
I want that the query should return in the same way as specified in "in" clause.
ie output should be in 350,241,251.
I would really appreciate if anyone can help.

You can achieve what you want like this:
select id from tableid where id in (350,241,251)
order by decode(id,350,1,241,2,251,3)in this example the decode explicitly defines the order you want to retrieve the records in.

Similar Messages

Maybe you are looking for

  • Boot Camp: Windows stuck on startup when external hard drive is attached

    Hi all, I have Windows XP installed with Boot Camp. All was working fine (even though I installed Service Pack 3 and THEN the Boot Camp update), but today I received an external hard drive I ordered for use with Time Machine. It's a Western Digital M

  • Oracle 8.1.7 on RH7.0 Installed fine now wont run at all!

    I was able to install Oracle 8.1.7 on RH 7.0 using this fix... http://ftp.valinux.com/pub/support/hjl/glibc/sdk/2.1/README.Oracle8i The database initialized correctly and I was able to setup and connect to the database. I even ran a port scanner and

  • Problems with exporting PDF for Print

    Hi all, I would appreciate some help with exporting my indesign document (using v9.2, 32x) to PDF for print. I have a number of images and text objects in the document and all links seem to be in place. However when I come to export the document to p

  • MIGO Screen No. of Containers field

    Now while doing GR i have to enter in how many pcs the material came No Basic unit of measure is in Metres In my GR screen under quanity tab No of containers field is there, There i have to enter in how many pieces i received the Material, there i ch

  • How to put vallidation check

    Respected,    I have created sales order then billing document of particular service and created an invoice for that order through CIC0 transaction code .customer enjoys the services if payment is due then i had to stop the services so how can I add