1、在这个表里 统计出第二张图的数据,写出Sql语句
select date ,stockCode,
SUM(case buysell when 'B' then Quantity else 0 end)as buyQuantity,
SUM(case buysell when 'S' then Quantity else 0 end) as SellQuantity
from table_1
group by stockCode,date
Case when 与 sum() count(*)搭配使用,统计经常用到