Get startedGet started for free

Sorting multiple fields

ORDER BY can also be used to sort on multiple fields. It will sort by the first field specified, then sort by the next, and so on. As an example, you may want to sort the people data by age and keep the names in alphabetical order.

Try using ORDER BY to sort multiple columns.

This exercise is part of the course

Intermediate SQL

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

-- Select the release year, duration, and title sorted by release year and duration
___
Edit and Run Code