Mysql中类型转换函数Cast()的用法
作者:互联网
Cast(字段名 as 转换的类型),其中类型可以为:
BINARY[(N)]
CHAR[(N)]
DATE
DATETIME
DECIMAL[(M[,D])]
SIGNED [INTEGER]
TIME
UNSIGNED [INTEGER]
用法:
SELECT CAST(ctime AS char) as new FROM user;
ctime是原列名, new是新列名
参考:
https://stackoverflow.com/questions/12126991/cast-from-varchar-to-int-mysql
标签:类型转换,ctime,列名,Mysql,用法,Cast,new,INTEGER 来源: https://www.cnblogs.com/v5captain/p/14526071.html