sql某列當中相同的類型累加
Java代碼
select Sum(case when buy_status =1 then 1 else 0 end) '訂購',
Sum(case when buy_status =2 then 1 else 0 end) '退訂',Sum(case when buy_status =6 then 1 else 0 end) '續訂'
from business_record
GROUP BY DATE(create_time)