By now, I understood there is no BOOLEAN
type in mysql and internally it converts to tinyint(1)
when the datatype is boolean.
But I also came across that tinyint
is not being handled by CAST
or CONVERT
function.
So basically my question is is there any direct way to typecast the datatype to TINYINT(1) the way it can be handled for any other data like DATE.
Examples :
select cast(column_name as DATE) -- Works
select cast(column_name as tinyint) -- Doesn't work
So how can I simply convert the type to tinyint(1)
without altering the table ..