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

Instruction

Nice job. You can also sort your rows by date using ORDER BY:

SELECT id, model, produced
FROM aircraft
WHERE produced BETWEEN '2010-01-01'
  AND '2010-12-31'
ORDER BY produced;

As usual, you can add ASC or DESC after the ORDER BY clause to set the sorting order.

Exercise

Select the id and date of all flights in 2015 and sort them with the newest dates coming first.

Stuck? Here's a hint!

Remember about the proper date format and use apostrophes: 'YYYY-MM-DD'. Newest dates first means you need the DESCending order.

Console

Code editor

Result

TableConsole