原文章地址 https://blog.csdn.net/weixin_40157571/article/details/78717946
1.TRUNC(number, num_digits)?
Number 需要截尾取整的數(shù)字旨涝。 Num_digits 用于指定取整精度的數(shù)字索赏。Num_digits 的默認(rèn)值為 0。
TRUNC()函數(shù)截取時(shí)不進(jìn)行四舍五入娄帖。
2. TRUNC詳解
? ??2.1 select trunc(123.458) from dual? ?結(jié)果:123
????2.2 select trunc(123.458,0) from dual? 結(jié)果:123
? ? 2.3 select trunc(123.458,1) from dual 結(jié)果:123.4
????2.4 select trunc(123.458,-1) from dual?結(jié)果:120
????2.5 select trunc(123.458,-4) from dual?結(jié)果:0
????2.6 select trunc(123.458,4) from dual? 結(jié)果:123.458
????2.7 select trunc(123) from dual? 結(jié)果:123
????2.8 select trunc(123,1) from dual? 結(jié)果:123
????2.9 select trunc(123,-1) from dual?結(jié)果:120