Deviopath › PostgreSQL

Staff List by Department

Easy · Sorting

ORDER BY can take several columns. Rows are sorted by the first one, and the next column only decides between rows that tie. Add DESC after a column to sort it from high to low (ASC, low to high, is the default).

Return department, last_name and salary for every employee, sorted by department A to Z, then by salary from highest to lowest, then by last_name A to Z.

Next: Three Most Expensive