Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Sorting in a query

RE: Sorting in a query

From: Gaston, William <wgaston_at_usg.com>
Date: Fri, 10 Dec 2004 10:26:49 -0700
Message-ID: <20942DC78B4BBB49A1567DB0E5E81EB50D5E0F60@dctr-exbe-001.usg.net>


I tried the decode and it works perfectly. Thanks for the help.

Bill

William Gaston
Systems Designer / Information Technology USG Corporation
Chicago, Il 60606
(312) 606-3851
wgaston_at_usg.com

-----Original Message-----
From: Maertensj_at_mont.disa.mil [mailto:Maertensj_at_mont.disa.mil]=20 Sent: Friday, December 10, 2004 11:20 AM To: Gaston, William
Subject: RE: Sorting in a query

You might try a decode in your where clause. I'm not sure this will help, but it might be possible to do something like=20

select ...
where x in (:n1, :n2...)
order by decode(x, :n1, 1, :n2, 2...)

Anyway, just a thought.

-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]
On Behalf Of Gaston, William
Sent: Friday, December 10, 2004 11:02 AM To: Oracle-L_at_freelists.org
Subject: Sorting in a query

I have an odd problem. I have a list of numbers that serve as=20 extract parameters in a query select ...where x in number list). =20 The numbers are in a specific sequence which does not match=20 the sequence of the extracted data. The user wants the data in=20 the same order as the list of numbers supplied. Is there any easy=20 way to do this within the query?
=20

Thanks for any help.
=20

Bill
=20

William Gaston
Systems Designer / Information Technology USG Corporation
Chicago, Il 60606
(312) 606-3851
wgaston_at_usg.com
=20

--
http://www.freelists.org/webpage/oracle-l
--
http://www.freelists.org/webpage/oracle-l
Received on Fri Dec 10 2004 - 11:28:15 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US