返回首页

这个查询生成完错误,任何人都可以帮助我吗?

SET

 Age =

 (

CASE  WHEN (not [Date of Death]  is null)

 THEN   datediff(year, [Birth date], [Date of Death] )

 

ELSE

     ( datediff(year , [Birth date], [Date of Retirement])

 

 END

 )

 

 WHERE

 PID!=''

回答

评论会员:理查德MacCutchan 时间:2012/02/04
{C}不平衡括号中的任何机会
评论会员:游客 时间:2012/02/04
?Prera​​k帕特尔
更新语法:

UPDATE yourTableName

SET Age =

 (

CASE  WHEN (not [Date of Death]  is null)

 THEN   datediff(year, [Birth date], [Date of Death] )

 

ELSE

     ( datediff(year , [Birth date], [Date of Retirement])

 

 END

 )

WHERE

 PID!=''