mysql 数据类型转换

CAST(expr AS type), CONVERT(expr,type), CONVERT(expr USING transcoding_name)
The CAST() and CONVERT() functions take a value of one type and produce a value of another type.
The type can be one of the following values:
BINARY[(N)]
CHAR[(N)]
DATE
DATETIME
DECIMAL DECIMAL(12,4)
SIGNED [INTEGER]
TIME
UNSIGNED [INTEGER]

mysql> select cast(now() as char);

posted @ 2017-06-26 17:14  乱笙歌  阅读(136)  评论(0编辑  收藏  举报