摘要: 1、错误SQL :select o.PK_ORG,o.NAME_TC,o.FK_ORGfrom dbo.org o left join dbo.ORGDUTY od on o.PK_ORG =od.FK_ORG and o.FK_SRCMAIN =od.FK_SRCMAIN where od.FK_DUTY =1 and o.fk_srcmain=2021此时,Where 子句中错误放置 " od.FK_DUTY=1 " 会过滤掉 dbo.ORGDUTY 不存在资料的 dbo.ORG, 即把Left Join 该有的作用给抵消了。2、正确SQL :select o.PK_O 阅读全文
posted @ 2013-11-08 16:11 chenyizh 阅读(489) 评论(0) 推荐(0) 编辑