Ordering Results

Example:

SELECT first_name, last_name, salary
FROM employees
ORDER BY salary DESC;

Explanation: This command retrieves the first_name, last_name, and salary of employees, ordering the results by salary in descending order. If you wanted ascending order, you could use ASC or simply omit it, as it’s the default.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *