• 数字 function


    SELECT 
    TRUNC(15.79),
    TRUNC(15.79,1),
    ROUND(15.79),
    ROUND(15.79,1),
    ROUND(115.79,-2),
    FLOOR(26.983),
    CEIL(26.123),
    SIGN(-25),
    SIGN(0),
    SIGN(25),
    MOD(10,4)
    FROM dual;
    TRUNC(15.79) TRUNC(15.79,1) ROUND(15.79) ROUND(15.79,1) ROUND(115.79,-2) FLOOR(26.983) CEIL(26.123)  SIGN(-25)    SIGN(0)   SIGN(25)  MOD(10,4)
    ------------ -------------- ------------ -------------- ---------------- ------------- ------------ ---------- ---------- ---------- ----------
              15           15.7           16           15.8              100            26           27         -1          0          1          2 

    TRUNC:
    Returns the number or expression passed as parameter
    Syntax:
    TRUNC(original_number[,n])
    The parameter for the number of decimals (n
    original number to convert it into an integer.
    If n is negative, the function truncates n digits to the left of the decimal point.
    ROUND:
    Returns the number or expression passed as parameter
    Syntax:
    ROUND(original_number[,n])
    The parameter for the number of decimals (n
    original number to convert it into an integer.
    If n is negative, the function rounds off n digits to the left of the decimal point.
    FLOOR:
    Returns the largest integer that is equal to or less than
    decimals from the original number, if it is not an integer.
    integer.
    Syntax:
    FLOOR(original_number)
    CEIL:
    Returns the smallest integer that is greater than or equal to
    number passed has decimals it returns the next integer.
    Syntax:
    CEIL(original_number)
    SIGN:
    Returns a number that represents the sign of the number passed as parameter
    number passed is positive it returns 1, and it returns 0 if the number passed is 0.
    Syntax:
    SIGN(number)
    MOD:
    Returns the remainder of the first_number divided by
    Syntax:
    MOD(first_number,second_number)

  • 相关阅读:
    centos7 yum安装配置Lnmp和负载配置
    Linux搭建lamp(Apache+PHP+Mysql环境)centos7.2版详细教程
    php的移位符运算
    Mysql的注入与防御
    介绍10个非常有用的PHP函数
    PHP性能的分析
    Netty 4源码解析:服务端启动
    centOS6.6升级gcc4.8
    kafka 0.8.x producer Example(scala)
    spark standalone zookeeper HA部署方式
  • 原文地址:https://www.cnblogs.com/kakaisgood/p/9566207.html
Copyright © 2020-2023  润新知