我有两张桌子,'学生'和老师'。'学生'有两列' roll',' class'。'老师'还有2列' id',' class'。我想获取一些' roll'来自学生的专栏'表格的某些值为' class'列将与' class'的值匹配老师的专栏' table.can你能帮我解决一下吗?
**student** **teacher**
roll class id class
1 one 101 one
2 three 102 three
3 five 103 four
答案 0 :(得分:1)
SELECT Roll FROM Student S. INNER JOIN老师T ON S.Class = T.Class
答案 1 :(得分:0)
SELECT
student.roll
FROM
student
INNER JOIN teacher ON student.class = teacher.class