Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
Dealing with dates
Working with time
13. Using BETWEEN with time data
Date and time data types in PostgreSQL
Extracting dates and times
Timezone conversion
Format date and time
Current date and time data
Summary

Instruction

You can also use BETWEEN with time data:

SELECT
  code,
  departure_time
FROM route
WHERE arrival_time BETWEEN '12:00:00'
  AND '15:00:00';

Remember that BETWEEN is inclusive in the above query, routes that depart at 12:00 AM or 3:00 PM will be included in the results.

Exercise

Show the codes for all routes departing between 11:00 AM and 5:00 PM.