Getting Top Results
Combine ORDER BY and LIMIT.
sql
1SELECT * FROM students
2ORDER BY marks DESC
3LIMIT 10;Returns top 10 highest marks.
Top Performers
sql
1SELECT name, marks FROM students
2ORDER BY marks DESC
3LIMIT 5;
Combine ORDER BY and LIMIT.
1SELECT * FROM students
2ORDER BY marks DESC
3LIMIT 10;Returns top 10 highest marks.
1SELECT name, marks FROM students
2ORDER BY marks DESC
3LIMIT 5;