Introduction
Dates
7. Dates with logical operators
Time
Timestamps
Extract functions
Timezone conversion
Intervals
Current date and time
Revision

Instruction

Good. It is also quite easy to use dates with logical operators other than the equality sign. Take a look at the following example:

SELECT id, model, produced
FROM aircraft
WHERE produced > '2010-12-31';

In SQL, a date which is "greater than" 2010-12-31 means that you will get all the production dates after that date (i.e. since 2011-01-01 until today). Similarly, putting the "less than" sign instead (<) will shown older dates.

Exercise

Select the columns id, model, produced for all the aircraft which were produced after December 31, 2012.

Stuck? Here's a hint!

Remember about the proper date format and use apostrophes: 'YYYY-MM-DD'.

Console

Code editor

Result

TableConsole