------代码------
SELECT *
FROM student
INNER JOIN score ON student.sid = score.student_id
INNER JOIN class ON student.class_id = class.cid;
-------student为主表,score和class为从表 要想实现三表连接,就只需要再创建一个主表与从表外键约束------
------以下为运行结果------
原文地址:https://www.cnblogs.com/iexhongxin/p/11371868.html
时间: 2024-11-13 05:46:22