方法一:

SELECT CAST('123' AS SIGNED);( 整数)

SELECT CAST('5.45' AS DECIMAL(9,2));( 浮点)


方法二:SELECT CONVERT('123',SIGNED);


方法三:SELECT '123'+0;



参考连接:https://blog.csdn.net/sweetgirl520/article/details/80277899

欢迎留言