title: how to delete every record except one per hour
body: <p>I have a mysql table with millions of sensor records with the following structure:</p>
  
  <pre><code>datanumber (auto increment), 
  stationid (int), 
  sensortype (int),
  measuredate (datetime),
  data (medtext)
  </code></pre>
  
  <p>each stations adds a record every 2-10 minute per sensortype (2-5 sensors)</p>
  
  <p>I would like to keep only one record per hour, per sensor, per station
  and this too only if measuredate is older than 1 year.</p>
  
  <p>I understand how to select data older than one year but I have no clue on how to delete rows except one for each hour. It does not really matter if it's the first, last or a random value which is kept at each hour. I also do not need to calculate average values or something, just strip down the amount of records stored</p>