文章目錄
開始:
-----round()用法與展示-----
round處理數據四捨五入
select round(3.5) from dual;
select round(3.4) from dual;
小數點後可以調整精度
select round (1.2345,3) from dual;
-----trunc()用法與展示-----
trunc可以截取小數點後的某幾位數字
select trunc(1.23456,4) from dual;
-----floor()用法與展示-----
floor取整
select floor(1.234) from dual;
-----ceil()用法與展示-----
ceil向上取整,一定大於或等於當前數
select ceil(1.234) from dual;
-----nvl()用法-----
nvl(x1,x2) ↓
x1不爲null就返回x1,如果x1是null,就返回x2
-----nvl2()用法-----
nvl2(x1,x2.x3) ↓
x1不爲null就返回x2,否則返回x3