Created
April 22, 2021 22:17
-
-
Save mttjohnson/6117759711e61540be577479269965db to your computer and use it in GitHub Desktop.
Magento 2 - Order Count by Date/Hour
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Magento 2 Order Summary by date/hour | |
select date_format( created_at, '%Y-%m-%d %H:00' ) date_hour, | |
count(*) order_count | |
from sales_order o | |
where o.created_at > '2021-01-01' and o.created_at < '2021-04-10' | |
group by date_format( created_at, '%Y%m%d%H' ) | |
having order_count > 100 | |
order by order_count desc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment