首页 文章

使用医学关系表加入两个表[关闭]

提问于
浏览
-3

我有三张 table

表格1

enter image description here

表2

enter image description here

table3(这是table1和表2的关系表)

enter image description here

如何使用table3连接table1和table2?我需要以下输出

什么是sql?

enter image description here

1 回答

  • 1

    这是一个例子:

    SELECT s.studentname
        , s.studentid
        , s.studentdesc
        , h.hallname
    FROM students s
    INNER JOIN hallprefs hp
        on s.studentid = hp.studentid
    INNER JOIN halls h
        on hp.hallid = h.hallid
    

相关问题