将sname,degree,rank三表组合匹配成一张新表
grade表
scores表
student表
SELECT sname,degree,rank FROM students
INNER JOIN scores ON (students.`sno` = scores.`sno`)
INNER JOIN grade ON
(scores.`degree` >= grade.`low` AND scores.`degree` <= grade.`upp`)
ORDER BY degree DESC
result
网友评论