我有两个表,'student'和'teacher'。'student'有2列'roll','class'。'teacher'也有2列'id','class'。我想获取一些' “学生”表中的“滚动”列,其“班级”列的某些值将与“老师”表中“班级”列的值相匹配。您能给我一个解决方案吗?
**student** **teacher**
roll class id class
1 one 101 one
2 three 102 three
3 five 103 four
SELECT
student.roll
FROM
student
INNER JOIN teacher ON student.class = teacher.class
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句