Hi I'm trying to create a new lookup tables in which I need all columns that have date values from all the tables in a particular schema. When I'm trying to UNION the column, I am getting only the result of 1st select and seems like union is not working here. How can I get all these columns in my new table? Here's my code for reference:
CREATE TABLE datetime_test AS (
SELECT col1, null as col2, null as col3 from table1
union all
select col1, col2, col3 from table2
union all
select col1, col2, null as col3 from table3 );