Bỏ qua nội dung

Sắp xếp với 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

Tài liệu

Đăng nhập hoặc tạo tài khoản

IGCSE, A-Level & AP