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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL ORDER BY Question

Re: SQL ORDER BY Question

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Thu, 2 Sep 1999 09:49:52 +0200
Message-ID: <7qlaer$eah$1@oceanite.cybercable.fr>


In your case, another way is: order by mod(X,4)

Paul Q a écrit dans le message
<8clz3.13488$r92.160335_at_news2.rdc1.on.home.com>...
>decode('X',1,1,5,1,2,2,6,2,3,3,7,3,4,4,8,4) service
>
>
>khs_at_netset.com wrote in message <37cdd18f.121019_at_news.netset.com>...
>>Ok, I want to include a column (lets call it X) in my ORDER BY clause
>>of a SELECT statement but I have a problem with the data.
>>
>>For column X:
>>Values '1' and '5' represent Army
>>Values '2' and '6' represent Navy
>>Values '3' and '7' represent Marines and
>>Values '4' and '8' represent AirForce
>>
>>I want to order the results by X (service) but if I do this I'll get
>>all the '1's then '2's, '3's, '4's and then 5,6,7,8. I won't get all
>>the Army (or any other service) rows together like I want. Is there
>>some way to make this sort like I want without changing the column
>>values?
>>
>>Thanks in advance....
>>You can email me at JAMES.STRICKLAND_at_dfas.mil
>>
>>
>
>
Received on Thu Sep 02 1999 - 02:49:52 CDT

Original text of this message

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