我想选择这样的
如何获取数据count_attendance?
答案 0 :(得分:0)
您可以使用子查询来执行此操作:
select name, gol, count(attendance) as count_data,(Select count(attendance) from tablename n where n.attendance='yes' and n.name=tablename.name and n.gol=tablename.gol) as count_attendance from tablename group by name,gol
只需将tablename替换为您的表名。