Sorting and Limiting Results in MySQL

Published September 30, 2026 By Sai Sree Ram Gundepudi

ORDER BY

SELECT * FROM employees ORDER BY salary DESC;

LIMIT

SELECT * FROM employees LIMIT 5;

Aliases

SELECT name AS employee_name FROM employees;

Was this solution helpful?

Your feedback helps improve our technical knowledge repository.

Share this article