Passer au contenu
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 lists Sara 95, Mei 88, Lin 88, Jamal 72, Tom 64; Mei and Lin tie

Fiche de cours

Se connecter ou créer un compte

IGCSE, A-Level & AP