Sort by Multiple Columns
sql
1SELECT * FROM students
2ORDER BY grade, marks;Example
Sort by grade first, then marks within grade:
sql
1SELECT name, grade, marks FROM students
2ORDER BY grade, marks;Result
| name | grade | marks |
|---|---|---|
| David | A | 85 |
| Alice | A | 92 |
| Bob | B | 75 |
| Carol | B | 78 |
