Arbitrary order in SQL query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bhushanbagul
    New Member
    • Jun 2007
    • 16

    Arbitrary order in SQL query

    Hi All,

    I want to sort oracle SQL as below
    e.g. employee table having column name, now i want to display records where employee names start with letter 'L' should appear first then starts with 'B' and then start with 'F'.
    Thanks in advance.
    Bhushan
  • amitpatel66
    Recognized Expert Top Contributor
    • Mar 2007
    • 2358

    #2
    [code=oracle]
    SELECT * FROM employee ORDER BY DECODE(UPPER(SU BSTR(fname,1,1) ),'L',0,'B',1,' F',2,9);
    [/code]

    Comment

    • bhushanbagul
      New Member
      • Jun 2007
      • 16

      #3
      Thanks to you amit

      Comment

      Working...