In the selection from the dept_manager table, why NULL AS emp_no?
In the selection from the dept_manager table, why did we insert a NULL AS emp_no, knowing that this field exists in both tables?
1 answers ( 0 marked as helpful)
Hi Anas!
Thanks for reaching out.
UNION and UNION ALL could be applied to two tables that have the same structure (i.e. we could have split e.g. the 'departments' table into two, and then use UNION to combine the two parts), so we can create additional columns with NULL values for both tables, so that the "new" tables with the NULL columns would fit and thus can be combined with UNION / UNION ALL.
Hope this helps.
Best,
Tsvetelin
Submit an answer
related questions
Resolved:
Getting Null as the result from all stored procedure queries including the assignment too.