Oracle
1Z0-047 · Question #10
Evaluate the following SQL statement: SELECT 2 col1,ycol2 FROM dual UNION SELECT 1 ,'x' FROM dual UNION SELECT 3 .NULL FROM dual ORDER BY 2; Which statement is true regarding the output of the SQL…
The correct answer is B. It would execute and the order of the values in the first column would be 1,2,3. See the full explanation below for the reasoning.
Question
Evaluate the following SQL statement:
SELECT 2 col1,ycol2 FROM dual UNION SELECT 1 ,'x' FROM dual UNION SELECT 3 .NULL FROM dual ORDER BY 2; Which statement is true regarding the output of the SQL statement?
Options
- AIt would execute and the order of the values in the first column would be 3,2,1.
- BIt would execute and the order of the values in the first column would be 1,2,3.
- CIt would not execute because the column alias name has not been used in the ORDER BY clause.
- DIt would not execute because the number 2 in the ORDER BY clause would conflict with the value 2
How the community answered
(21 responses)- A10% (2)
- B81% (17)
- C5% (1)
- D5% (1)
Community Discussion
No community discussion yet for this question.