扫码关注官方订阅号
业精于勤,荒于嬉;行成于思,毁于随。
试试下面的语句:
select team_name,sum(if(score='正',1,0)) as'正',sum(if(score='负',1,0)) as '负' from teamscore group by team_name;
应该是:
SELECT team_name, count(*) AS win WHERE score = '正' GROUP BY team_name SELECT team_name, count(*) AS loss WHERE score = '负' GROUP BY team_name
再想办法把这两个结果合起来。
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
试试下面的语句:
应该是:
再想办法把这两个结果合起来。