Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Dates
Time
Timestamps
Extract functions
25. EXTRACT with a wrong data type – continued
Timezone conversion
Intervals
Current date and time
Review

Instruction

Error! That's what you got, as you could have expected. It's not possible to extract any part of date from a time column … But it's possible to extract a field of time from a date column. It will just provide a zero. Let's give it a try.

Exercise

For each flight, show its id, date, and the hour extracted from the field date (name the column hour).

Stuck? Here's a hint!

Syntax reminder:

SELECT EXTRACT(YEAR FROM launched) AS year
FROM aircraft;