0
我必須聲明Update語句根據選擇
update Clients
set StatusID= 4
from (select c.clientid
from Clients c
where CategCode = 'CH' and StatusID in (1,2,6) and DATEDIFF(YEAR,dob,GETDATE())>5)
它扔我的錯誤
Msg 102, Level 15, State 1, Line 5
Incorrect syntax near ')'.
你看看有什麼可以導致此錯誤?
我試圖用這個聲明,但其設定狀態4對所有客戶端
update Clients
set StatusID= 4
WHERE EXISTS(
select clientid,DOB,DATEDIFF(YEAR,dob,GETDATE())
from Clients
where CategCode = 'CH' and StatusID in (1,2,6) and DATEDIFF(YEAR,dob,GETDATE())>5
拋出錯誤'消息156,Level 15,State 1,Line 2 關鍵字'set'附近的語法不正確。' – Andrey 2013-03-17 22:17:55
check updat ed回答 – 2013-03-17 22:19:21
不認識這部分'x.clienid = c.cliendid' – Andrey 2013-03-17 22:21:51