When I try to run a union on a column with an INT and a VARCHAR, I get a "data conversion error"
The statement does work in MySQL as MySQL converts int to VARCHAR and returns both results as VARCHAR.
If I am try a union with an INT and a FLOAT, the query is successful and both results are converted into FLOAT.
I am curious as to whether this inconsistency with MySQL is by design or not? Thanks.
Here is a quick example:
drop table test;
create table test(id int, name varchar);
insert into test values(1, 'a');
(select id from test)
union (select name from test);
Here is the error