Thursday, February 10, 2011

Manul Sorting - Order by particular Alphabets


SELECT   haou.NAME, haou.TYPE,HR.MEANING
    FROM hr_all_organization_units haou,HR_LOOKUPS HR
   WHERE TYPE IS NOT NULL
   AND HR.LOOKUP_TYPE = 'ORG_TYPE'
   AND HR.LOOKUP_CODE = HAOU.TYPE
ORDER BY CASE WHEN TYPE IN ('BG','GR','DE','SE','UN') THEN 0 ELSE 1 END ASC,TYPE ASC


No comments:

Post a Comment