我有一个Student
表,其中包含以下列
Student_id|Marks
9|90
1|37
和Grade_discription
表
Min_Score|Max_Score|Grade
0|30|c
31|60|B
61|90|A
我想要输出
Student_id|Grade
1 |B
答案 0 :(得分:0)
select s.Student_id, g.Grade
from Student s join Grade_discription g
on s.Marks between g.Min_Score and g.Max_Score
order by s.Student_id;
<强>输出强>
Student_id|Grade
1 |B
9 |A