title: Re-Ordering the Months By Federal Fiscal Year
body: <p>When running the following query I am trying to find a way to display the returned months by federal fiscal year instead of normal sequential value.</p>
  
  <p>(ie I want to display months in the following order Oct, Nov, Dec, Jan, Feb, Mar, Apr, May Jun, Jul, Aug, Sept instead of Jan thru Dec.) Thanks</p>
  
  <pre><code>select wrkgrp,
      sum (case when extract(month from reportdate) = 1 then 1 else 0 end) as January,
      sum (case when extract(month from reportdate) = 2 then 1 else 0 end) as February,
      sum (case when extract(month from reportdate) = 3 then 1 else 0 end) as March,
      sum (case when extract(month from reportdate) = 4 then 1 else 0 end) as April,
      sum (case when extract(month from reportdate) = 5 then 1 else 0 end) as May,
      sum (case when extract(month from reportdate) = 6 then 1 else 0 end) as June,
      sum (case when extract(month from reportdate) = 7 then 1 else 0 end) as July,
      sum (case when extract(month from reportdate) = 8 then 1 else 0 end) as August,
      sum (case when extract(month from reportdate) = 9 then 1 else 0 end) as September,
      sum (case when extract(month from reportdate) = 10 then 1 else 0 end) as October,
      sum (case when extract(month from reportdate) = 11 then 1 else 0 end) as November,
      sum (case when extract(month from reportdate) = 12 then 1 else 0 end) as December,
  from workorder
  where reportdate between to_date ('2014-10-01 00:00:00', 'yyyy/mm/dd hh24:mi:ss')
  and   to_date ('2015-09-30 00:00:00', 'yyyy/mm/dd hh24:mi:ss')
  and   wrkgrp = 'PublicWorks'
  group by 'wrkgrp;'
  </code></pre>