1Z0-071 · Question #231
Evaluate the following SQL statement: SQL> select cust_id, cust_last_name "Last name" FROM customers WHERE country_id = 10 UNION SELECT cust_id CUST_NO, cust_last_name FROM customers WHERE…
The correct answer is A. ORDER BY "Last name" B. ORDER BY 2, cust_id D. ORDER BY 2, 1. Using the ORDER BY Clause in Set Operations - The ORDER BY clause can appear only once at the end of the compound query. - Component queries cannot have individual ORDER BY clauses. - The ORDER BY clause recognizes only the columns of the first SELECT query. - By default, the…
Question
Evaluate the following SQL statement:
SQL> select cust_id, cust_last_name "Last name" FROM customers WHERE country_id = 10 UNION SELECT cust_id CUST_NO, cust_last_name FROM customers WHERE country_id = 30 Identify three ORDER BY clauses either one of which can complete the query.
Options
- AORDER BY "Last name"
- BORDER BY 2, cust_id
- CORDER BY CUST_NO
- DORDER BY 2, 1
- EORDER BY "CUST_NO"
How the community answered
(21 responses)- A71% (15)
- C10% (2)
- E19% (4)
Explanation
Using the ORDER BY Clause in Set Operations - The ORDER BY clause can appear only once at the end of the compound query. - Component queries cannot have individual ORDER BY clauses. - The ORDER BY clause recognizes only the columns of the first SELECT query. - By default, the first column of the first SELECT query is used to sort the output in an ascending
Topics
Community Discussion
No community discussion yet for this question.