QuestionQ64

VerifiedUsing Subqueries to Solve Queries

Examine the following statement:

Question Image

Identify three ORDER BY clauses, any one of which can complete the query successfully.

Choose three
Explanation

For a compound query using UNION, the final ORDER BY may refer to select-list positions or to the column names/aliases from the first component query. The valid references are position 2 followed by cust_id, positions 2 and 1, and the quoted first-query alias "Last Name". CUST_NO exists only as an alias in the second component query, so it is not a valid result-column reference.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!