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: Paul Q <paulq_at_home.com>
Date: Thu, 02 Sep 1999 02:23:00 GMT
Message-ID: <8clz3.13488$r92.160335@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 Wed Sep 01 1999 - 21:23:00 CDT

Original text of this message

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