这是DB的方案。如何从MySQL的3个表中选择Name,Second Name和Name_Chairrr ????
SELECT p.Name, p.Second_Name, c.Name_CHAIRRR
FROM Professors p
JOIN pchairs pc ON pc.ID_Professor = p.ID_professor
JOIN Chairs c ON c.ID_chair = pc.ID_Chair
答案 0 :(得分:0)
您必须将表连接在一起并使用别名。试试这个
SELECT p.Name, p.Second_Name, c.Name_CHAIRRR
FROM Professors p
JOIN pchairs pc ON pc.ID_Professor = p.ID_professor
JOIN Chairs c ON c.ID_chair = pc.ID_Chair
答案 1 :(得分:0)
我认为你正在寻找这个
select
p.name,
p.second_name,
c.name_chairrr
from
professors p
inner join
pchairs pc
on
p.id_professor=pc.id_professor
inner join
chairs c
on
pc.id_chair=c.id_chair