title: Get COUNT of hours on 30 mins Interval
body: <p>I have this below data.</p>
  
  <pre>
  Date    Interval
  2014-01-01  12:00 AM
  2014-01-01  12:30 AM
  2014-01-01  1:00 AM
  2014-01-01  1:30 AM
  2014-01-01  2:00 AM
  2014-01-01  2:30 AM
  2014-01-01  3:00 AM
  2014-01-01  3:30 AM
  2014-01-01  4:00 AM
  2014-01-01  4:30 AM
  </pre>
  
  <p>I need to extract the hour of the interval column.</p>
  
  <p>I could do it using <code>EXTRACT('hour', Interval)</code> which gives me the hour numbers as <code>int</code>.</p>
  
  <p>Result will be as follows: </p>
  
  <pre>
  Date    Interval    HourCount
  2014-01-01  12:00 AM    0
  2014-01-01  12:30 AM    0
  2014-01-01  1:00 AM 1
  2014-01-01  1:30 AM 1
  2014-01-01  2:00 AM 2
  2014-01-01  2:30 AM 2
  2014-01-01  3:00 AM 3
  2014-01-01  3:30 AM 3
  2014-01-01  4:00 AM 4
  2014-01-01  4:30 AM 4
  </pre>
  
  <p>But what I'm looking for is. I need the count for every 30 mins as 1.</p>
  
  <p>Example data what I'm looking for.</p>
  
  <pre>
  Date    Interval    HourCount
  2014-01-01  12:00 AM    1
  2014-01-01  12:30 AM    2
  2014-01-01  1:00 AM 3
  2014-01-01  1:30 AM 4
  2014-01-01  2:00 AM 5
  2014-01-01  2:30 AM 6
  2014-01-01  3:00 AM 7
  2014-01-01  3:30 AM 8
  2014-01-01  4:00 AM 9
  2014-01-01  4:30 AM 10
  </pre>
  
  <p>This way, in a day I'll be getting 48 intervals.</p>
  
  <p>I could use <code>ROW_NUMBER() OVER (PARTITION BY Date ORDER BY Date)</code>. But this will give me wrong count if any interval is been missed out.</p>
  
  <p>Suppose if the below row is missed out.</p>
  
  <pre>
  2014-01-01  4:00 AM 9
  </pre>
  
  <p>I'll be getting <code>9</code> as the HourCount for this row.</p>
  
  <pre>
  2014-01-01  4:30 AM 9
  </pre>
  
  <p>Someone help me to get the count of hours on 30 mins interval.</p>