title: Select query for fetching data on the interval of 4 hours
body: <p>I am using postgres 8.1 database and I want to write a query which select data on the interval of 4 hours. </p>
  
  <p>So as image show subscriber_id with date, this how currently data available in the database and</p>
  
  <p><a href="https://i.stack.imgur.com/f90CW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f90CW.png" alt="enter image description here"></a></p>
  
  <p>I want data like</p>
  
  <pre><code>No. of Subscriber |  Interval
        0               0-4
        0               4-8
        7               8-12
        1               12-16
        0               16-20
        0               20-24
  </code></pre>
  
  <p>basically in each day we have 24 hours, if I divide 24/4=6 means I have total 6 intervals for each day</p>
  
  <pre><code>0-4
  4-8
  8-12
  12-16
  16-20
  20-24
  </code></pre>
  
  <p>So I need count of subscribers within these intervals. Is there any data function in postgres which solve my problem or how can I write a query for this problem ?</p>
  
  <p>NOTE : Please write your solution according to postgres 8.1 version</p>