2012-12-21 42 views

回答

1
update table1 set 
    name = @name, 
    appid = (case when @appid is null or id=54 then appid else @appid end) 
where [email protected] 
+0

貌似运作良好.. :) –

0

这对你有帮助吗?

update 
    table1 
set [email protected], 
    appid=ISNUL(@appid, appid) 
where 
    id=(CASE WHEN @id=54 THEN id+1 ELSE @id END)