4. ORDER BY and LIMIT
ORDER BY sorts results. DESC sorts high to low and ASC low to high. LIMIT keeps only the first rows.
Show example
SELECT name, marks FROM students ORDER BY marks DESC LIMIT 5;
Results
Nothing found. Try another word.
ORDER BY sorts results. DESC sorts high to low and ASC low to high. LIMIT keeps only the first rows.
SELECT name, marks FROM students ORDER BY marks DESC LIMIT 5;