Skip
Arish's avatar

88. Descending Order


ASC and DESC

  • ASC: Ascending (default, lowest to highest)
  • DESC: Descending (highest to lowest)

Syntax

sql
1SELECT * FROM students
2ORDER BY marks DESC;

Example: Highest Marks First

sql
1SELECT name, marks FROM students
2ORDER BY marks DESC;

Mixed Ordering

sql
1SELECT * FROM students
2ORDER BY grade ASC, marks DESC;