这是什么SQL语法啊,从未见过,以下是全文select sc.cid as 课程ID,course.name as 课程名,SUM(CASE WHEN score BETWEEN 85 AND 100 THEN 1 ELSE 0 END) AS [100 - 85],SUM(CASE WHEN score BETWEEN 70 AND 85 THEN 1 ELSE 0 END) AS [85-70],SUM(CA
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/25 06:52:14
这是什么SQL语法啊,从未见过,以下是全文select sc.cid as 课程ID,course.name as 课程名,SUM(CASE WHEN score BETWEEN 85 AND 100 THEN 1 ELSE 0 END) AS [100 - 85],SUM(CASE WHEN score BETWEEN 70 AND 85 THEN 1 ELSE 0 END) AS [85-70],SUM(CA
这是什么SQL语法啊,从未见过,
以下是全文
select sc.cid as 课程ID,course.name as 课程名
,SUM(CASE WHEN score BETWEEN 85 AND 100 THEN 1 ELSE 0 END) AS [100 - 85]
,SUM(CASE WHEN score BETWEEN 70 AND 85 THEN 1 ELSE 0 END) AS [85-70]
,SUM(CASE WHEN score BETWEEN 60 AND 70 THEN 1 ELSE 0 END) AS [60 - 70]
,SUM(CASE WHEN score< 60 THEN 1 ELSE 0 END) AS [
这是什么SQL语法啊,从未见过,以下是全文select sc.cid as 课程ID,course.name as 课程名,SUM(CASE WHEN score BETWEEN 85 AND 100 THEN 1 ELSE 0 END) AS [100 - 85],SUM(CASE WHEN score BETWEEN 70 AND 85 THEN 1 ELSE 0 END) AS [85-70],SUM(CA
sum方法是求和
SUM(CASE WHEN score BETWEEN 85 AND 100 THEN 1 ELSE 0 END) AS [100 - 85]
意思是如果分数是在 85-100 的话求和加1否则加0
得到就是 [100 - 85] 字段就是这个分数段的人数