Custom order in Oracle PL/SQL
Posted
by Jasim
on Stack Overflow
See other posts from Stack Overflow
or by Jasim
Published on 2010-05-11T09:22:36Z
Indexed on
2010/05/11
9:34 UTC
Read the original article
Hit count: 234
I have an oracle query in which and i want the result to be in custom order 'SENIOR DIRECTOR', 'DIRECTOR', 'MANAGER', 'EMPLOYEE' which is from the field GRADE_DESCRIPTON. I am using the below query.
However I am not getting the desired result The order of the result im getting is 'SENIOR DIRECTOR','MANAGER', DIRECTOR,'EMPLOYEE'
SELECT DISTINCT GRADE_DESCRIPTION, HIRING_FORECATS.* FROM GRADE_MASTER left join IRING_FORECATS ON (HIRING_FORECATS.GRADE = GRADE_MASTER.GRADE_DESCRIPTION and HIRING_FORECATS.LOCATION = 'HO' ) order by decode(GRADE_MASTER.GRADE_DESCRIPTION, 'SENIOR DIRECTOR', 'DIRECTOR', 'MANAGER', 'EMPLOYEE')
Any Suggestions??
© Stack Overflow or respective owner