-
I am trying to get the results of following SQL displayed in the order of selection as follows:
select dept_code, dept_name from dept
where dept_code IN ('B', 'C', 'A');
Goal is to get the results in the order of dept_code listed in IN_CLAUSE:
Dept_code Dept_name
---------------------------
B DeptB
C DeptC
A DeptA
Please help.
-
select dept_code, dept_name from dept
where dept_code IN ('B', 'C', 'A');
ORDER BY DECODE(dept_code, 'B', 1, 'C', 2, 'A',3)
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|