Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Dates
9. Dates with ORDER BY
Time
Timestamps
Extract functions
Timezone conversion
Current date and time
Review

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 the proper date format and use apostrophes: 'YYYY-MM-DD'. Newest dates first means you need the DESCending order.