Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL ORDER BY Question
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
![]() |
![]() |