select a.*,b.*,c.fl as fl2 from pu_zhje as a, pu_fl as b,s_faruser as c
where a.dlbm=15 and a.dlbm=b.userid and b.userid=c.userid本来是想这样写的
但是问题是
a.dlbm=15的时 b.userid没有等于15的 或者c.userid没有等于15的
这样怎么写啊 谢谢大家 帮帮我啊
where a.dlbm=15 and a.dlbm=b.userid and b.userid=c.userid本来是想这样写的
但是问题是
a.dlbm=15的时 b.userid没有等于15的 或者c.userid没有等于15的
这样怎么写啊 谢谢大家 帮帮我啊
--用LEFT JOIN
select a.*,b.*,c.fl as fl2
from pu_zhje as a LEFT JOIN pu_fl as b LEFT JOIN s_faruser as c
where a.dlbm=15 and a.dlbm=b.userid and b.userid=c.userid
--用LEFT JOIN
select a.*,b.*,c.fl as fl2
from pu_zhje as a LEFT JOIN pu_fl as b ON a.dlbm=b.userid
LEFT JOIN s_faruser as c ON b.userid=c.userid
where a.dlbm=15
where附近有错误
怎么改啊
--用LEFT JOIN
select a.*,b.*,c.fl as fl2
from pu_zhje as a LEFT JOIN pu_fl as b ON a.dlbm=b.userid
LEFT JOIN s_faruser as c ON b.userid=c.userid
where a.dlbm=15
select a.*,b.*,c.fl as fl2
from pu_zhje a
left join pu_fl b on a.dlbm=b.userid
left join s_faruser c on b.userid=c.userid
where a.dlbm=15