title: Order  by case results in SQL
body: <p>I have following query working :</p>
  
  <pre><code>SELECT
  COUNT(id), AgeRange
  FROM
  (
  select
  id,
  case
  when age &lt; 0 then 'less than 0'
  when age &gt;= 0 and age &lt;=30 then '0-30'
  when age &gt;= 31 and age &lt;=60 then '31-60'
  when age &gt;= 61 and age &lt;=90 then '61-90'
  when age &gt;= 91 then '91+'
  when age = null then 'NO INFORMATION'
  else 'no catagory'
  end AS AgeRange
  from queue 
  where DATE between '01-Apr-2011' and '05-May-2011'
  ) T
  GROUP BY
  AgeRange;
  </code></pre>
  
  <p>Now my requirement is that, I want these result to be printed always in a sequence, first for less than 0, than for 31-60 and so on. </p>
  
  <p>Even if get count 0 for any interval say 31-60. It should return 0 for that interval. Can anyone help. </p>
  
  <p>Further clarification: what I want is if for any case I am getting zero count it should also print that.</p>
  
  <p>In my table of database for this query it is not displaying the 'less than 0' case:</p>
  
  <pre><code>COUNT(ID) AGERANGE       AGERANGESEQUENCE
  -------------- -------------- ----------------
       11139 0-30                          2
        2292 31-60                         3
         329 61-90                         4
        1078 91+                           5
         746 NO INFORMATION                6
  </code></pre>
  
  <p>Its not showing me the first row of count 0.</p>
  
  <p>I want that too, so that I can get a well defined table structure.</p>