The prototypes are as shown here:
cast(expression AS type)
convert(expression, type)
The cast() function is ANSI compliant, and convert() is ODBC compliant.
Valid types are BINARY, CHAR, DATE, DATETIME, SIGNED (INTEGER), and UNSIGNED (INTEGER).
Most casting in MySQL happens automatically when needed; for example, if feeding numbers into a string function, they will automatically be cast as strings.
No comments:
Post a Comment