I am trying to display count of orders and aggregate it per day. These dates are not continuous, they will display the count only when there are orders on that day. How should I write my MySQL query? I tried using below query but, no luck so far.
Query1: Display count of all orders for each orderCutOffDay
Query2: Display count of all orders for each orderLastUpdated
orders table structure -
orderID - bigint
orderCutOffDay - date
orderLastUpdated - datetime
__timeGroup(date, '24h') as time_sec, count(orderID) as value, orderID as metric FROM orders WHERE __timeFilter(date)
GROUP BY 1
ORDER BY 1
Any help is much appreciated. Thanks!