Reputation: 275
I am performing a union between two tables. In order to make the two tables consistent for a UNION, I need to add a dummy column.
One table has DATE field whereas the other table does not have that field. How can I create the dummy DATE field which can either be '' (blank) or NULL?
I am trying something like this in DB2
TO_DATE('','MM/DD/YYYY') AS DUMMY_DATE
Upvotes: 0
Views: 4179
Reputation: 49260
Just select null
.
select col1, datecol from table1
union all
select col1, null from table2
Upvotes: 2