Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Oracle 中是否有任何内部函数支持银行家的舍入,我需要在选择查询中使用一半到奇数的银行家舍入
四舍五入到最接近的奇数:
CASE WHEN MOD( ABS( value ), 2 ) = 1.5 THEN TRUNC( value ) ELSE ROUND( value ) END
四舍五入到最接近的奇百位:
CASE WHEN MOD( ABS( value ), 0.02 ) = 0.015 THEN TRUNC( value, 2 ) ELSE ROUND( value, 2 ) END