QuestionQ57

VerifiedRestricting and sorting data

Which two statements are correct about the ORDER BY clause when it is used with a SQL statement that contains a set operator such as UNION?

Explanation

For an Oracle compound query, the result-column names come from the select list before the set operator, so only names from the first SELECT are recognized. An ORDER BY clause applies to the complete compound result and can appear only in the last component query; it may use select-list positions or aliases, and no output order is guaranteed when it is absent.

Learn more

Community Discussion

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