[英]MySQL query to find if a value of one column in one table is between two values in two columns on another table
Long title question, so my apologies for that! 长标题问题,对此我深表歉意! I have two tables, one is as follows:
我有两个表,一个如下:
Student Name Grade John Doe 96 John Foe 65 Dan Doe 76 Mary Doe 85
The other table, is as follows: 另一个表如下:
Grade Start Grade End Status 0 60 Bad Student 61 70 OK Student 71 80 Good Student 81 90 Great Student 91 100 Honor Student
I am trying to create a MySQL view that will pull the student's grade, and tell me the status of that student such as: 我正在尝试创建一个MySQL视图,该视图将提高学生的成绩,并告诉我该学生的状态,例如:
Student Name Grade Status John Doe 90 Honor Student John Foe 65 OK Student
So on and so forth. 等等等等。 I can't think of a query that will give me that information.
我想不出一个可以提供该信息的查询。 I'm at a complete loss with the query, any help?
我对查询完全不知所措,有什么帮助吗?
SELECT student_name, student_grade from student_grade_table WHERE ???
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.