CAST() in MySQL — How It Works
What the MySQL CAST() function does, with an example.
Published October 22, 2026
CAST() converts a value from one data type to another using standard SQL syntax.
Key points
- Part of standard SQL functions available in MySQL for working with query results
Example
SELECT CAST('123' AS UNSIGNED);