Introduction
Dates
Time
14. Time with ORDER BY
Timestamps
Extract functions
Timezone conversion
Intervals
Current date and time
Revision

Instruction

Good! And the last thing, you can sort by time, too.

SELECT code, departure
FROM route
ORDER BY arrival DESC;

Just like with dates again.

Exercise

Show the code and arrival of all the routes with arrival before 4 PM and order them by arrival with the earliest time coming first.

Stuck? Here's a hint!

Remember about the proper time format and use apostrophes: 'HH:MM:SS'. 4 PM is '16:00:00' in SQL.

Console

Code editor

Result

TableConsole