成都网站建设设计

将想法与焦点和您一起共享

mysql类型转换

  1. 语法:
    CAST (expr AS type)
  2. 类型:
    BINARY          #  二进制字符串
    CHAR(n)         #  普通字符串
    DATE            #  日期字符串
    DATETIME        #  时间日期字符串
    DECIMAL(m,n)    #  精确浮点数
    SIGNED          #  整数(有正负)
    TIME            #  时间字符串
    UNSIGNED        #  整数(正数)
  3. 示例:
    MySQL> select cast('25' as signed);
    +----------------------+
    | cast('25' as signed) |
    +----------------------+
    |                   25 |
    +----------------------+

网站题目:mysql类型转换
当前URL:http://chengdu.cdxwcx.cn/article/jjoecs.html