Skip
Arish's avatar

90. Mixed ASC and DESC


Mixed Ordering

Different columns, different directions.

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

Youngest first, within same age: highest marks first.

Example

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