QuestionQ53

VerifiedUsing the Set Operators

Which column or columns are used by default to sort the output of compound queries that use SET operators, such as INTERSECT, in a SQL statement?

Explanation

The first component SELECT establishes the compound result set’s output-column names and positions. Therefore, the intended default sort key is the first column in that first SELECT. For a guaranteed row order, Oracle requires an ORDER BY clause on the compound query; without one, Oracle does not guarantee result order.

Learn more

Community Discussion

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