Discussion
Which one of the following sorts rows in SQL?
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.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development