求大神,关于sql查询的问题
selectu.id_asuserId_,o.name_asorgName_,p.name_aspostName_,u.name_,u.employeeno_fromfw...
select u.id_ as userId_,o.name_ as orgName_,p.name_ as postName_,u.name_,u.employeeno_ from fw_user u ,fw_post p,fw_organization o where u.postId_ = p.id_ and u.orgId_ = o.id_ and u.enable_ = 1这个语句怎么改,如果o.name_ as orgName_这个为空的情况也查出来
展开
2个回答
展开全部
lz试试看,有问题再追问。
select u.id_ as userId_,
o.name_ as orgName_,
u.postName_,
u.name_,
u.employeeno_
from
fw_organization o
left join
(select p.name_ as postName_,
u.name_,
u.employeeno_
from fw_user u ,fw_post p
where u.postId_ = p.id_
and u.enable_ = 1)u
on u.orgId_ = o.id_
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询