Thanu Thanu - 1 year ago 65
MySQL Question

How to change the data type in a view?

In MySQL is there a way to change the data type of a field, other than the original data type, without having an intermediate table involvement?

Answer Source

Have a look at 12.10. Cast Functions and Operators

The CAST() function takes an expression of any type and produces a result value of a specified type, similar to CONVERT().

CAST(expr AS type)


CONVERT(expr,type), CONVERT(expr USING transcoding_name)