oracle ceil取整,ceil取整

來源:互聯網
上載者:User

oracle ceil取整,ceil取整
select ceil(3.05/0.5),3.05/0.5 from dual;

ceil(3.05/0.5)  = 7
3.05/0.5   = 6.1
ceil(3.55/0.5)  = 8
3.55/0.5   = 7.1
Oracle取整的函數

ceil(x) 向上取整
floor(x) 向下取整
round(x,n) 當n=0時就是取整,四捨五入法則

x是你的小數
 
Oracle取整的函數

關於Oracle取整的函數分別有以下幾種:

  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
 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.