decode 横竖转换时间:2024-01-04 14:10:50 select rq 日期,sum(decode(shengfu,'胜',1,'负',0)) 胜,sum(decode(shengfu,'负',1,'胜',0)) 负 from tmp group by rq; 结果: