我正在运行以下 SQL,但 0 案例似乎总是受到打击:
select
ccy.numberofdecimals,
ABS(round(ts.TRADECCY1AMOUNT, 2)),
CASE
WHEN CCY.NUMBEROFDECIMALS = 0 THEN
CONVERT(Numeric(38,0), ABS(round(TS.TRADECCY1AMOUNT, 0)))
WHEN CCY.NUMBEROFDECIMALS = 2 THEN
CONVERT(Numeric(38,2), ABS(round(TS.TRADECCY1AMOUNT, 2)))
WHEN CCY.NUMBEROFDECIMALS = 3 THEN
CONVERT(Numeric(38,3), ABS(round(TS.TRADECCY1AMOUNT, 3)))
END as 'Transaction Amount',
FROM
blah blah blah
然而我的结果集总是:
当我删除小数位数 0 时,它会产生正确的结果。任何人都知道为什么这个案例陈述总是评估 0 案例?
谢谢!