title: mysql query to select data per hour
body: <p>I am trying to build a query to get data per hour for a particular day(or today). 
  I have a device data table that </p>
  
  <pre><code>#   Name                      Type      
      1  : idPrimary  --       int(11)                
      2 : inputDate   --      varchar(32) 
      3 : input1      --      varchar(11)     
      4 : input2      --      varchar(11) 
  </code></pre>
  
  <p>And in inputDate   my data in this format :</p>
  
  <pre><code>SELECT inputDate FROM `deviceData` WHERE `inputDate` BETWEEN '2015-05-29 16:30:07' AND '2015-05-29 21:30:07' ORDER BY id 
  </code></pre>
  
  <p>Showing rows 0 - 24 (3304 total, Query took 0.3487 seconds.)
  <div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>2015-05-29 16:30:09
  2015-05-29 16:30:20
  2015-05-29 16:30:25
  2015-05-29 16:30:41
  2015-05-29 16:30:46
  2015-05-29 16:30:51
  2015-05-29 16:30:56
  2015-05-29 16:31:01
  2015-05-29 16:31:07
  2015-05-29 16:31:49
  2015-05-29 16:31:54
  2015-05-29 16:32:00
  2015-05-29 16:32:10
  2015-05-29 16:32:15</code></pre>
  </div>
  </div>
  
  Now I want to take only one data in a hour, The minutes and seconds isn't important.For example :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>2015-05-29 5:*:*
  2015-05-29 6:*:*
  2015-05-29 7:*:*
  2015-05-29 8:*:* </code></pre>
  </div>
  </div>
  </p>
  
  <p>I don't know the best way to do this. I use regex but i can't do this.
  Thanks  </p>