Given the following tables:
YEAR_2006
EMPID NAME
———————————
1 Jagger, Mick
2 Richards, Keith
3 Wood, Ronnie
4 Watts, Charlie
5 Jones, Darryl
6 Leavell, Chuck
YEAR_1962
EMPID NAME
———————————
1 Jagger, Mick
2 Richards, Keith
3 Jones, Brian
4 Wyman, Bill
5 Chapman, Tony
6 Stewart, Ian
If the following SQL statement is executed, how many rows will be returned?
SELECT name FROM year_2006
UNION
SELECT name FROM year_1962

A.
0
B.
6
C.
10
D.
12
UNION selects only distinct values. Use UNION ALL to also select duplicate values!
0
0
When DB2 encounters the UNION keyword, it processes each select / subselect to form an interim result table, then it combines the interim result table and deletes duplicate rows to form a combined result table working similar as a JOIN.
If the option is to keep the duplicate values, then the UNION ALL keyword should be used.
0
0