MySQL String to Integer Conversion Guide
In MySQL, you can convert a string to an integer type using either the CAST or CONVERT function.
For example, you can use the CAST function to convert a string to an integer.
SELECT CAST('123' AS SIGNED);
You can also use the CONVERT function to convert a string into an integer.
SELECT CONVERT('123', SIGNED);
Both of the above methods will convert the string ‘123’ into the integer 123.