无法弄清楚为什么我在此delete语句中遇到语法错误:
DELETE FROM RawServiceNow.dbo.u_loan
LEFT JOIN RawServiceNow.stg.ServiceNowDeletes ON
RawServiceNow.stg.ServiceNowDeletes.SysId = RawServiceNow.dbo.u_loan.SysId WHERE
ServiceNowDeltes.SysId IS NULL
错误:
消息156,级别15,状态1,第18行关键字附近的语法不正确 “左”。
答案 0 :(得分:2)
这是正确的语法:
DELETE u
FROM RawServiceNow.dbo.u_loan u
LEFT JOIN RawServiceNow.stg.ServiceNowDeletes s
ON s.SysId = u.SysId
WHERE s.SysId IS NULL