Machine-translated by Google. Questions are authored in English.
Top

Discussion

Which one of the following sorts rows in SQL?

  • A.SORT BY
  • B.ALIGN BY
  • C.ORDER BY
  • D.GROUP BY

Answer: C

Correct answer: ORDER BY

ORDER BY sorts the rows of a result, ascending by default and descending with DESC, and may name several columns for tie-breaking.

GROUP BY is the near-miss: it collects rows into groups for aggregation and does not guarantee any particular output order, though some engines happen to return groups sorted. SORT BY and ALIGN BY are not SQL. Note that without ORDER BY a result has no defined order at all - a set has no sequence - so any order observed is incidental.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.