我试图构建替换语句,但我收到此错误:替换语句
替换函数需要3个参数。
关键字'with'附近的语法不正确。如果此语句是公用表表达式,xmlnamespaces子句或变更跟踪上下文子句,则前面的语句必须以分号结尾。
SQL脚本:
select ccc.*,
replace(replace(replace(replace(replace(bbb.Text,
'[Change]',convert(varchar,CAST(coalesce(ccc.change,0) as decimal(10,2)))),
'[CurrentAmount]','$'+convert(varchar,CAST(coalesce(ccc.currentamount,0) as money),1),
'[Increase]',convert(varchar,CAST(coalesce(ccc.increase,0) as decimal(10,2))))+ '%',
'[AmountIncrease]',convert(varchar,CAST(coalesce(ccc.amountincrease,0) as decimal(10,2))))+ '%',
'[AmountDecrease]',convert(varchar,CAST(coalesce(ccc.amountdecrease,0) as decimal(10,2))))+ '%'
) Condition
from CCCCheck ccc with (NOLOCK)
inner join BBBCheck bbb with (NOLOCK)on...
作品!谢谢! –