Skip to content

Instantly share code, notes, and snippets.

@kolaente
Created February 12, 2020 09:54
Show Gist options
  • Save kolaente/8231686cf8027e73093d58cb83a02eee to your computer and use it in GitHub Desktop.
Save kolaente/8231686cf8027e73093d58cb83a02eee to your computer and use it in GitHub Desktop.
Magento order stats per day
select ROUND(SUM(base_grand_total), 2) total,
ROUND(AVG(base_grand_total), 2) average,
count(*),
DATE(created_at) dt
from sales_order
where created_at > '2020-01-01 00:00:00'
GROUP BY dt
order by dt;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment