I have following query which is supposed to count the total number of orders made by hour.
The problem is that total number is always 1 per hour. I have similar query for weekdays which works just fine. What is wrong or missing in the following query?
SELECT COUNT(`Orderno`) as 'totals', EXTRACT(HOUR FROM `order_datetime`) as 'hour'
FROM `orders`
GROUP BY `order_datetime`
Results are
totals hour
1 0
1 1
1 2
...