Which statement is true regarding the UNION operator?
A.
The number of columns selected in all SELECT statements need to be the same
B.
Names of all columns must be identical across all SELECT statements
C.
By default, the output is not sorted
D.
NULL values are not ignored during duplicate checking
Explanation:
The SQL UNION query allows you to combine the result sets of two or more SQL SELECT
statements. It removes duplicate rows between the various SELECT statements.
Each SQL SELECT statement within the UNION query must have the same number of fields in the
result sets with similar data types.
d is also correct
https://community.oracle.com/thread/1030639?start=0&tstart=0
The only correct answer is D.
A is wrong because this works …
select CONCAT(CUST_FIRST_NAME, CUST_SECON_NAME) from customers — 2 columns selected
UNION
select NAME from cust — 1 column selected
Eamon, you’re wrong.
When you execute this query:
select 1, 2 from dual
union
select 1 from dual;
it results with an error:
ORA-01789: query block has incorrect number of result columns.
Hello Shape,
Please note I did use a CONCAT function. The code you placed here is doesn’t.
Try this….
SQL> select CONCAT(‘A’, ‘B’) from dual
2 union
3 select ‘AC’ from dual
4 /
CO
—
AB
AC
By the way I completed this exam. I have some (approx 10) updated questions if you are interested.
mail me on [email protected]
Good luck
I think ‘B’ and ‘D’ are Correct Answer.
A and D are correct