--03 SQL statement, the value type of the function

ROUND (column name | expression, n)

rounded to n bits after the decimal point
idle> select round(458.734,0),round(458.734,1),round(458.734,-1) from dual;

ROUND(458.734,0) ROUND(458.734,1) ROUND(458.734,-1)
---------------- ---------------- -----------------
      459    458.7 460

idle>

TRUNC (column name | expression, n)

Truncated to n bits after the decimal point
idle> select trunc(458.734,0),trunc(458.734,1),trunc(458.734,-1) from dual


TRUNC(458.734,0) TRUNC(458.734,1) TRUNC(458.734,-1)
---------------- ---------------- -----------------
      458    458.7 450

idle>

MOD(m,n)

求m除以n的余数
idle> select mod(10,3) from dual;

 MOD(10,3)
----------
  1

idle>
idle> select mod(3,10) from dual;

 MOD(3,10)
----------
  3

idle>

CEIL 取整 向上补1  和trunc相反

idle> select ceil(457.001) from dual;   后面只要有小数,就进一

CEIL(457.001)
-------------
   458

idle>

power(底数,指数) 求次方

SQL> select power(10,3) from dual;

POWER(10,3)
-----------
       1000

SQL> 

 

 

 
 

Guess you like

Origin www.cnblogs.com/marxist/p/11708111.html