Sorting and Limiting Results in MySQL

Published July 26, 2025 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