January 2019
Beginner
556 pages
14h 19m
English
Comparison operators are less (<), more (>), less or equal ( <=), more or equal (>=), equal (=), and not equal (<> or !=—these two are synonyms). These operators can compare not only numbers but any values that can be compared, for example, dates or strings. There is a BETWEEN construct that also relates to comparing. Consider the following:
x BETWEEN a AND b
The preceding code is equivalent to the following:
x >= a AND x <= b
The OVERLAPS operator checks to see whether two ranges of dates overlap. Here is an example:
car_portal=> SELECT 1 WHERE (date '2018-10-15', date '2018-10-31') OVERLAPS (date '2018-10-25', date '2018-11-15'); ?column?---------- 1
Read now
Unlock full access