20190917002 - SQL 中处理交叉重复条件参考

SELECT     E.EmpNo, E.EmpName, P.PartName, P.Part1Name, P.Part3Name, D3.InfoName AS DutyName, D15.InfoName AS SexName
FROM         dbo.HR_Employee AS E LEFT OUTER JOIN
                      dbo.V_HRDocumentSet AS D2 ON E.EmployeeStationID = D2.AutoID LEFT OUTER JOIN
                      dbo.V_HRDocumentSet AS D1 ON E.DutyTypeID = D1.AutoID LEFT OUTER JOIN
                      dbo.V_PartSet AS P ON E.PartID = P.PartID LEFT OUTER JOIN
                      dbo.V_HRDocumentSet AS D ON D.AutoID = E.EmployeeTypeID LEFT OUTER JOIN
                      dbo.V_HRDocumentSet AS D3 ON D3.AutoID = E.DutyID LEFT OUTER JOIN
                      dbo.V_HRDocumentSet AS D10 ON D10.AutoID = E.NativeID LEFT OUTER JOIN
                      dbo.V_HRDocumentSet AS D11 ON D11.AutoID = E.NationID LEFT OUTER JOIN
                      dbo.V_HRDocumentSet AS D14 ON D14.AutoID = E.LeaveTypeID LEFT OUTER JOIN
                      dbo.V_HRDocumentSet AS D15 ON D15.AutoID = E.SexID
WHERE     E.Incumbency = '1'

posted @ 2019-09-17 16:16  追逐苦痛  阅读(219)  评论(0编辑  收藏  举报