title: How to create data categories in sql query?
body: <p>Mt table has 3 columns:</p>
  
  <pre><code>user_id, start_time, end_time
  </code></pre>
  
  <p>I want to write a SQL query which can return it in the form of</p>
  
  <pre><code>Time Spent  Users
   0-30 sec      4   
  30-60 sec     20
   1- 5 min      1
   5-30 min      0
  30-60 min      0
  60+   min      0
  </code></pre>
  
  <p>Category name 'a - b'  contains all values t, with <code>a &lt;= t &lt; b</code>.
  I can keep the time spent categories fixed.</p>
  
  <p>My data:</p>
  
  <pre><code>user_id  start_time                      end_time
      230  08-NOV-15 09.13.42.000000000 PM 08-NOV-15 09.13.42.000000000 PM 
      231  08-NOV-15 11.53.32.000000000 PM 08-NOV-15 11.54.16.000000000 PM
  </code></pre>
  
  <p>Please advise if can be done with a single Oracle SQL query</p>