一个SQL查询出每门课程的成绩都大于80的学生姓名

name   kecheng   chengji     表名score
张三     语文     81
张三     数学     75
李四     语文     76
李四     数学     90
王五     语文     81
王五     数学     100
王五     英语     90

最简单的方法:

select name from score group by name having MIN(chengji >= 80);

猜你喜欢

转载自www.cnblogs.com/fzxing/p/12753509.html