CAST
或 CONVERT
函数进行数据类型转换。将字符串转换为整数:,,``sql,SELECT CAST('123' AS UNSIGNED);,-或者,SELECT CONVERT('123', UNSIGNED);,
`,,将日期转换为字符串:,,
`sql,SELECT CAST(NOW() AS CHAR);,-或者,SELECT CONVERT(NOW(), CHAR);,
``CAST
或 CONVERT
函数进行数据类型转换。将字符串转换为整数:,,``sql,SELECT CAST('123' AS UNSIGNED);,-或者,SELECT CONVERT('123', UNSIGNED);,
`,,将日期转换为字符串:,,
`sql,SELECT CAST(NOW() AS CHAR);,-或者,SELECT CONVERT(NOW(), CHAR);,
``Powered By Z-BlogPHP 1.7.3