from SOOpsTransferHeader a left join SOOpsTransferDetail b on a.site=b.site and a.TransNo=b.TransNo left join SOScheduledRouting c on b.seqNo=c.seqNo and a.site=c.site
from SOOpsTransferHeader a
left join SOOpsTransferDetail b on a.site=b.site and a.TransNo=b.TransNo
left join SOScheduledRouting c on b.seqNo=c.seqNo and a.site=c.site
<where>
<where>
and a.need_inspect_flag='Y' and a. Status!='已取消' and a.ToTypeFlag!='调拨入仓库'
and a.need_inspect_flag='Y' and a. Status!='已取消' and a.ToTypeFlag!='调拨入仓库'