sql-多表连接查询中,多加个条件怎么一并查询出来?
selecta1.username,b1.orgname,a3.appTimeleavetm,a2.appTimeovertm,frompub_usera1leftjoi...
select a1.username,b1.orgname,a3.appTime leavetm ,a2.appTime overtm, from pub_user a1 left join f_attendApp a3 on a1.userid=a3.userid left join jiabansqd a2 on a2.userid=a1.userid left join pub_org b1 on b1.orgid=a2.orgid=a3.orgid where a2.processInsStatus !=9; 下面的语句怎么结合到上面的sql中一起查询出来? SELECT DATEDIFF(f.appTime,f1.appTime) AS sjhoho FROM jiabansqd f ,f_attendApp f1
两句sql 并为一句,怎么查出来? 展开
两句sql 并为一句,怎么查出来? 展开
展开全部
selectDATEDIFF(f.appTime,f1.appTime) AS sjhoho,
a1.username,b1.orgname,a3.appTime leavetm ,a2.appTime overtm, from jiabansqd f ,f_attendApp f1,
pub_user a1 left join f_attendApp a3 on a1.userid=a3.userid left join jiabansqd a2 on a2.userid=a1.userid left join pub_org b1 on b1.orgid=a2.orgid=a3.orgid where a2.processInsStatus !=9
a1.username,b1.orgname,a3.appTime leavetm ,a2.appTime overtm, from jiabansqd f ,f_attendApp f1,
pub_user a1 left join f_attendApp a3 on a1.userid=a3.userid left join jiabansqd a2 on a2.userid=a1.userid left join pub_org b1 on b1.orgid=a2.orgid=a3.orgid where a2.processInsStatus !=9
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询