我有這個疑問這是工作確定只更新表,如果字段爲空
UPDATE Master
SET Closed = Date(),
Status = 'Closed',
[Closure Reason] = 'Not on Extract'
WHERE NOT EXISTS (SELECT 1
FROM Extract
WHERE Master.Case = Extract.Case
);
我需要修改它添加另一個條件,即只做更新,如果主的價值。[關閉原因]爲NULL
但是,這給出了一個語法錯誤:
UPDATE Master SET Closed = Date(), Status = 'Closed', [Closure Reason] = 'Not on Extract'
WHERE [Closure Reason] = "" AND
WHERE NOT EXISTS (SELECT 1
FROM Extract
WHERE Master.Case = Extract.Case
);
我已經嘗試使用IS NULL而不是= 「」 無濟於事。
請問它有什麼問題?
2項
WHERE
條款一AND
條件運算符'IS NULL'應該爲你希望做什麼工作。您應該使用該結構顯示查詢。 –