Which statement is true regarding the UNION operator?
A.
By default, the output is not sorted.
B.
NULL values are not ignored during duplicate checking.
C.
Names of all columns must be identical across all SELECT statements.
D.
The number of columns selected in all SELECT statements need not be the same.
Why D is wrong. I thought same # of columns must be needed for union.
number and datatypes has to be same..
No. of columns and the datatypes of the column being selected must be identical in all the Select statement used in the query.
Why A is wrong? I read some material said “UNION by default produces an unordered set of rows” from http://docs.oracle.com/cd/E17952_01/refman-5.1-en/union.html
Why A is wrong?
By default output sorted in the asc order of the first column of the select clause
NULL values are not ignored
Number of columns and data types need to be identical,names need not to identical
Option B is correct.
By default output is sorted in the ascending order of the first column of the select clause
Null values are ignored
Names need not to be identical
The number of columns AND DATA TYPES selected in the select clause need to be same
For Option A :- By default the output get sorted while using Union.
Option D is also true regarding Union
read again “The number of columns selected in all SELECT statements NEED NOT BE the same.”
The number of columns NEED BE the same
What about C?
C also correct I think
No. C is wrong. DATATYPE of each column must be the same (correctly: similar), no its name.