1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
select DATE_FORMAT(created_on,'%Y-%m-%d') as date_label, sum(amount) as total from summary_orders where status = 2 and created_on >= '2019-03-25' and created_on <= '2019-04-13' group by date_label order by date_label SELECT sum(amount) as total FROM `summary_orders` where `campaign_id` = '150' and status = 2 select count(distinct user_id) as total from summary_orders where status = 2 and created_on >= '2019-03-25' and created_on <= '2019-04-13' select DATE_FORMAT(created_on,'%Y-%m-%d') as date_label, count(distinct user_id) as total from summary_orders where status = 2 and created_on >= '2019-03-25' and created_on <= '2019-04-13' group by date_label order by date_label |