当前位置:Gxlcms >
数据库问题 >
写一个SQL: student(Sno, Sname, classId, grade )查出每个班成绩前三名的同学
写一个SQL: student(Sno, Sname, classId, grade )查出每个班成绩前三名的同学
时间:2021-07-01 10:21:17
帮助过:169人阅读
SELECT * FROM student stu WHERE (
SELECT COUNT(*) FROM student
WHERE stu.classid=classid AND stu.grade >= grade
GROUP BY classid HAVING COUNT(*)<=3
)
写一个SQL: student(Sno, Sname, classId, grade )查出每个班成绩前三名的同学
标签:and name div from sid rom class bsp select