Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 30th, 2013  |  syntax: None  |  size: 0.55 KB  |  views: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. 0 - expire
  2. 1 - approval
  3. 2 - pending
  4. 3 - counting
  5.        
  6. 1 - approval ,
  7. 3 - counting,
  8. 0 - expire
  9. 2 - pending.
  10.        
  11. -- sampe of data from 0 to 3
  12. SQL> with t1(x) as(
  13.   2    select level - 1
  14.   3      from dual
  15.   4    connect by level <= 4
  16.   5  )
  17.   6  select *  -- actual query
  18.   7    from t1
  19.   8   order by case x
  20.   9              when 0 then 'expire'
  21.  10              when 1 then 'approval'
  22.  11              when 2 then 'pending'
  23.  12              when 3 then 'counting'
  24.  13            end
  25.  14  ;
  26.          X
  27. ----------
  28.          1
  29.          3
  30.          0
  31.          2
clone this paste RAW Paste Data