Skip to main content
Version: 24.3.x

Categories: Date/Time

OVERLAPS

Returns whether two intervals overlap.

Syntax

expression1 string OVERLAPS expression2 → boolean

  • expression1: A date or time interval expression.
  • expression2: A date or time interval expression.

Examples

OVERLAPS example
SELECT (TIME '2:55:00', INTERVAL '1' HOUR) OVERLAPS (TIME '3:30:00', INTERVAL '2' HOUR)
-- True
OVERLAPS example
SELECT pickup_datetime FROM Samples."samples.dremio.com"."NYC-taxi-trips-iceberg" WHERE (DATE '2013-01-01' , DATE '2014-12-31' ) OVERLAPS ( DATE '2013-06-01' , DATE '2013-07-01' ) LIMIT 3
-- pickup_datetime
-- 2013-02-10 21:59:00.000
-- 2013-02-10 22:00:00.000
-- 2013-02-10 21:57:00.000