|
-
ORDER BY decode(job,'Clerk',1, 'President',2, 'Analyst',3, 'Salesman',4,'Manager',5,6)
might be what you are looking for.
Be wary of using this sort of construct though - if the jobs change, then you will have to recode any select statements that use it. I have included a default value of 6 so that any jobs that are not listed in the decode will appear at the end of the sort.
It might be better to have a jobs table, and replace the job name in your table with a job id that refers to jobs. Then you could have a sort priority column in the jobs table, and use that to order your results. This means that if jobs are added, the sort order can be changed without recoding anything.
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
|