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

Instruction

Fine! The query worked this time.

Intervals are typically used with the comparison operators (e.g. >, >=) to select facts from a given day, month, year etc. Take a look:

SELECT id
FROM aircraft
WHERE produced >= '2010-01-01'
  AND produced < CAST('2010-01-01' AS date) + INTERVAL '1' YEAR;

The above query will look for aircraft produced in 2010. Note that we needed to use CAST when adding an interval.

Exercise

Show the id and the model for all the aircraft produced in 2014 and 2015.