如何使用WITH(NOLOCK)查询此查询。我知道如何使用它来进行正常的选择查询。但对于连接查询?任何一个引导我如何在查询中使用WITH(NOLOCK)加入
SELECT
DISTINCT Amendmentdetails.BadgeNo, ContractNo,isnull(Amendmentdetails.ContractAmendmentNo,'')AS ContractAmendmentNo,
value As AnnualSalary,
Amendmentdetails.ContractType,TimesheetCategory,Rotation,RM.CRotDayOn,RM.CRotDayOff ,TSCatDays
from Amendmentdetails
Left Join
RotationMaster RM
On
Amendmentdetails.Rotation =RM.CRotCode
Left Join
TimesheetCategoryMaster TM
On
Amendmentdetails.TimesheetCategory=TM.TSCatCode
Left Join
SalaryDetails
On
SalaryDetails.contractAmendmentNo =Amendmentdetails.ContractAmendmentNo AND
Paycode in(1001,1002,1003,1004,1005)
'随着(NOLOCK)'别名后在'JOIN'的'ON'之前去。任何MS文档都会告诉你。 –