1.取整(大) select ceil(-1.001) value from dual
2.取整(小) select floor(-1.001) value from dual
3.取整(截取) select trunc(-1.002) value from dual
4.取整(舍入) select round(-1.001) value from dual
本文介绍了SQL中常用的四种取整函数:向上取整(CEIL)、向下取整(FLOOR)、截断取整(TRUNC)及四舍五入取整(ROUND)。通过具体的SQL语句演示了每种函数如何处理负数小数。
2.取整(小) select floor(-1.001) value from dual
3.取整(截取) select trunc(-1.002) value from dual
4.取整(舍入) select round(-1.001) value from dual
您可能感兴趣的与本文相关的镜像

被折叠的 条评论
为什么被折叠?