Home  >  Article  >  Database  >  Mysql数字类型转换函数_MySQL

Mysql数字类型转换函数_MySQL

WBOY
WBOYOriginal
2016-06-01 13:39:121011browse

bitsCN.com

Mysql数字类型转换函数 1、将Int 转为varchar经常用 concat函数,比如concat(8,'0') 得到字符串 '80'  2、将varchar 转为Int 用 cast(a as signed) a为varchar类型的字符串   www.bitsCN.com  总结:类型转换和SQL Server一样,就是类型参数有点点不同:CAST(xxx AS类型),CONVERT(xxx,类型) 可用的类型  二进制,同带binary前缀的效果 : BINARY 字符型,可带参数 : CHAR() 日期 : DATE 时间: TIME 日期时间型 : DATETIME 浮点数 : DECIMAL 整数 : SIGNED 无符号整数 : UNSIGNED 

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn