sql关联有关问题ABC三个表
时间:2021-07-01 10:21:17
帮助过:3人阅读
sql关联问题A\B\C三个表,
sql关联问题A\B\C三个表,A.id = B.aid 和A.id= C.a2id,这种关联如何写?
------解决思路----------------------
select A.*,B.*,C.* from A
left join B on A.id = B.aid
left join C on A.id = B. a2id
------解决思路----------------------$user = M('A');
$user->join("left join B on A.id=B.Id left join C on c.id=b.id")->field("A.id as aid,B,id as bid,……")->select();