zoukankan      html  css  js  c++  java
  • mysql中floor函数的作用是什么?

    需求描述:

      最近写mysql程序的时候,使用了floor函数,在此记录下该函数的作用

    操作过程:

    1.使用floor函数的测试

    mysql> select floor(1.23),floor(-1.23);
    +-------------+--------------+
    | floor(1.23) | floor(-1.23) |
    +-------------+--------------+
    |           1 |           -2 |
    +-------------+--------------+
    1 row in set (0.00 sec)

    备注:根据官方文档的提示,floor函数返回小于等于该值的最大整数.

    示意图:

    官方文档参考:

    FLOOR(X)
    
    Returns the largest integer value not greater than X.
    
    mysql> SELECT FLOOR(1.23), FLOOR(-1.23);
            -> 1, -2
    
    For exact-value numeric arguments, the return value has an exact-value numeric type. 
    For string or floating-point arguments, the return value has a floating-point type. 注意:标记为黄色的部分还没有完全弄清楚.

    文档创建时间:2018年6月26日13:19:04

  • 相关阅读:
    CSS-16-margin值重叠问题
    CSS-15-定位
    CSS-14-浮动
    CSS-13-块级元素和行内元素
    CSS-12-盒子模型
    CSS-11-外边距
    CSS-10-内边距
    CSS-09-背景属性
    CSS-08-边框属性设置
    CSS-07-CSS文本设置
  • 原文地址:https://www.cnblogs.com/chuanzhang053/p/9228633.html
Copyright © 2011-2022 走看看