我试图在SQL条件连接的情况下使用not condition但我收到错误。
select * FROM #tmpInterfaceUpdateTriger tmpTrg
INNER JOIN Interface.InterfaceTrigger trg (NOLOCK) ON
tmpTrg.InterfaceTriggerID = trg.InterfaceTriggerId
INNER JOIN DataCollection.NonCustodialParentRelationship ncrp
ON trg.InterfaceTriggerCode NOT IN
case when trg.IndividualId = ncrp.ChildIndividualId
then ('AddressChange','EmploymentChange','GoodCauseChange','AbsentParentChange','CSSanctions') end
答案 0 :(得分:0)
您的查询应该是这样的。
SELECT
*
FROM #tmpInterfaceUpdateTriger tmpTrg
INNER JOIN Interface.InterfaceTrigger trg (NOLOCK)
ON tmpTrg.InterfaceTriggerID = trg.InterfaceTriggerId
INNER JOIN DataCollection.NonCustodialParentRelationship ncrp
ON trg.IndividualId = ncrp.ChildIndividualId
WHERE trg.InterfaceTriggerCode NOT IN ('AddressChange', 'EmploymentChange', 'GoodCauseChange', 'AbsentParentChange', 'CSSanctions')