mysql convert string to numeric type

Use cast and CONVERT as follows:

SELECT  

cast('1.00' as UNSIGNED INTEGER) as intval,

CONVERT('1.00',UNSIGNED INTEGER) as intval,

cast('1.234' as DECIMAL(4,3)) as decVal,

CONVERT('1.234',DECIMAL(4,3)) as decVal

 

search result:

111.2341.234

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326241090&siteId=291194637