我試圖構建替換語句,但我收到此錯誤:替換語句
替換函數需要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...
作品!謝謝! –