三张表
方法1:(内连接)
SELECT u.id,u.name,u.phone,c.name from A u,B i,C c where u.id = i.userid and c.id = b.campus
方法2:(左连接)
SELECT u.id,u.name,u.phone,c.name from user u
left join B i on u.id = i.userid
left join C c on c.id = i.campus;
2023-11-28 12:42:58
三张表
方法1:(内连接)
SELECT u.id,u.name,u.phone,c.name from A u,B i,C c where u.id = i.userid and c.id = b.campus
方法2:(左连接)
SELECT u.id,u.name,u.phone,c.name from user u
left join B i on u.id = i.userid
left join C c on c.id = i.campus;