I'm adding information to a view via UNION
. I currently have booleans in the table represented by TINYINT
. I need to maintain these columns as TINYINT
. The following information in the UNION
alters the datatype to BIGINT
:
<PREVIOUS SELECT (Type of isRequired = TINYINT)>
SELECT isRequired
FROM tableA
UNION
<NEW SELECT (After this, isRequired = BIGINT)>
SELECT
1 AS isRequired
FROM tableB
Apparently, MYSQL CAST()
will not convert to TINYINT
. How can I preserve the TINYINT
in the original view?