|
-
[QUOTE][i]Originally posted by akkerend [/i]
[B]You can order in almost any kind of order you want, i think in your case you can use decode:
SELECT *
FROM emp
ORDER BY decode(job,
'CLERK', 0,
'PRESIDENT', 1,
'MANAGER', 2,
'ANALYST', 3,
'SALESMAN',4,
5);
Or if you want to confuse your users:
SELECT *
FROM emp
ORDER BY translate(ename, rowidtochar(rowid), to_char(sysdate+31,'SSSPMMSPHH24SP'));
[/B][/QUOTE]
Use the DECODE statement sparingly. In this case, what if there were something new to sort by? You would have to change the query... Makes for a maintenance nightmare, IMHO of course.
Jeff Hunter
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
|