table order
num start_time end_time
20 2018-01-16 2018-01-18
10 2018-01-16 2018-01-17
15 2018-01-17 2018-01-18
25 2018-01-17 2018-01-19
10 2018-01-18 2018-01-19
20 2018-01-16 2018-01-16
30 2018-01-18 2018-01-19
25 2018-01-17 2018-01-19
35 2018-01-22 2018-01-23
10 2018-01-21 2018-01-22
selete result
date_time all_num
2018-01-16 50
2018-01-17 95
2018-01-18 125
2018-01-19 50
2018-01-21 10
2018-01-22 45
2018-01-23 35order表内有每个时间段内都会下单的量num
求查询出order的订单时间段内每天下单的量总和
num start_time end_time
20 2018-01-16 2018-01-18
10 2018-01-16 2018-01-17
15 2018-01-17 2018-01-18
25 2018-01-17 2018-01-19
10 2018-01-18 2018-01-19
20 2018-01-16 2018-01-16
30 2018-01-18 2018-01-19
25 2018-01-17 2018-01-19
35 2018-01-22 2018-01-23
10 2018-01-21 2018-01-22
selete result
date_time all_num
2018-01-16 50
2018-01-17 95
2018-01-18 125
2018-01-19 50
2018-01-21 10
2018-01-22 45
2018-01-23 35order表内有每个时间段内都会下单的量num
求查询出order的订单时间段内每天下单的量总和
date_time, COUNT(*) all_num
FROM
order
GROUP BY data_time
ORDER BY data_time;