Question 41
In the following query, how will the resultset be sorted?
Select * from my_table order by column_a desc, column_b, column_c
A. By column_a in descending order, by column_b in descending order, and,
finally, by column_c.
B. By column_a, column_b, and column_c, all in descending order.
C. By column_a, column_b, and column_c, all in ascending order.
D. By column_a.Any rows in which column_b has the same value will then be
resorted by column_c in descending order.
E. By column_a in descending order.Any rows in which column_a has the
same value will then be ordered by column_b in ascending order.Any rows
in which both column_a and column_b have the same value will be further
sorted by column_c in ascending order.
Answers 41
E is the correct answer.The resultset of the query will, first of all, be sorted by the
value of column_a in descending order, as dictated by the DESC clause. If, after the
first sorting operation, any rows have the same value for column_a, they will be
further sorted by column_b in ascending order. If any rows have the same value for
column_a and column_b, they will be further sorted by column_c in ascending
order.