title: Group by date hour in sql
body: <p>halo, i want to add <code>id</code> then <code>group by</code> product and date hour(without change the datetime to varchar). with data is:</p>
  <pre><code>datetime               product    sold
  2020-10-27 08:51:00       A        50
  2020-10-27 08:52:00       A        10
  2020-10-27 08:52:00       B        20
  2020-10-27 09:52:00       B        30
  </code></pre>
  <p>my query is:</p>
  <pre><code>select newId() as id, datehour(datetime) datehour, product, sum(sold)
  from table_a
  group by datehour(datetime), product
  </code></pre>
  <p>but did not work</p>
  <p>my expected result:</p>
  <p>note: the date hour should be datetime type not varchar</p>
  <pre><code>id   datehour               product    sold
  1    2020-10-27 08:00:00       A        60
  2    2020-10-27 08:00:00       B        20
  3    2020-10-27 09:00:00       B        30
  </code></pre>
  <p>note: the date hour should be datetime type not varchar</p>
  <p>any idea ?</p>