oracle 中rand()方法理解

函数原型 SELECT ROUND( number, [ decimal_places ] ) FROM DUAL

  例子:

           

select round(86.87) from dual;               回传 87

select round( 86.87 , 0) from dual;          回传 87

select round( 86.87 , 1) from dual;          回传 86.9

select round( 86.87 , 2) from dual;          回传 86.87

select round( 86.87 , 3) from dual;          回传 86.87


select round( 86.87 , -1) from dual;         回传 90

select round( 86.87 , -2) from dual;         回传 100

select round( 86.87 , -3) from dual;         回传 0

select round( 86.87 , -4) from dual;         回传0


select round( -86.87 , -1) from dual;        回传 -90

   通过例子,自己总结下吧。很容易明白。


你可能感兴趣的:(oracle)