Created
January 7, 2018 12:49
-
-
Save willboudle/80d8f8a7e45abb97e1b9d5624940610b to your computer and use it in GitHub Desktop.
Average Orders Per Day sql magento
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
| SELECT AVG( orders_num ) | |
| FROM ( | |
| SELECT created_at, COUNT( DISTINCT order_id ) orders_num | |
| FROM `sales_flat_order_item` | |
| WHERE created_at > "2016-07-01 00:00:00" | |
| AND created_at < "2017-01-01 00:00:00" | |
| GROUP BY CAST( created_at AS DATE ) | |
| )orders_per_day |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment