본문 바로가기

ORDER BY를 이용한 정렬

English
Sorting the result

The rows come back in no particular order. Add ORDER BY to sort them by a column:

SELECT name, score FROM student ORDER BY score DESC;
  • ASC sorts ascending (smallest first) — this is the default.
  • DESC sorts descending (largest first).

ORDER BY score DESC sorts the rows from highest to lowest score

교재 자료

로그인 또는 계정 만들기

IGCSE, A-Level & AP