sql 除法 除数为零
select decode(zzc,0,0,fz/zzc) from table
BigDecimal的devide的函数定义如下
BigDecimal.divide(BigDecimal divisor, int scale, RoundingMode roundingMode) ;
scale为小数位数;
roundingMode为小数模式;
ROUND_CEILING
本文介绍了如何在SQL中处理除数为零的情况,并提供了使用decode函数的示例。此外,还详细解释了BigDecimal的divide方法及其各种舍入模式。
sql 除法 除数为零
select decode(zzc,0,0,fz/zzc) from table
BigDecimal的devide的函数定义如下
BigDecimal.divide(BigDecimal divisor, int scale, RoundingMode roundingMode) ;
scale为小数位数;
roundingMode为小数模式;
ROUND_CEILING
被折叠的 条评论
为什么被折叠?