O'Reilly logo

Joe Celko's SQL for Smarties, 5th Edition by Joe Celko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 19

BETWEEN and OVERLAPS Predicates

Abstract

The BETWEEN and OVERLAPS predicates both offer a shorthand way of showing that one value lies within a range defined by two other values. BETWEEN works with scalar range limits of any type; the OVERLAPS predicate looks at two time periods.

Keywords

BETWEEN

OVERLAPS

SYMMETRIC

ASYMMETRIC

NULLs

INTERVAL

The between and OVERLAPS predicates both offer a shorthand way of showing that one value lies within a range defined by two other values. BETWEEN works with scalar range limits of any type; the OVERLAPS predicate looks at two time periods (defined either by start and end points or by a starting time and an INTERVAL) to see if they overlap in time.

19.1 The BETWEEN Predicate

The BETWEEN predicate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required