摘要:
group by a:将所有具有相同a字段值的记录放到一个分组里; group by a,b :将所有具有相同a字段值和b字段值的记录放到一个分组里 count( case when sex='1' then '男') as count1, count( case when sex='2' then 阅读全文
摘要:
select date(p.create_time) as one_day,sum(a-b) as total, p.cashier from pay_order p where p.create_time between date_format('2019-08-12 08:08:08','%Y%m%d') and date_format('2019-08-13 08:08:08','%Y%m% 阅读全文