How to Use BETWEEN Correctly

The BETWEEN clause is used to validate if a value is in a range. For example

Select a from generate_series(1,20) where a between 5 and 9

Is equivalent to:

Select a from generate_series(1,20) where a >= 5 and a <= 9

As expected the result will be:

a
5
6
7
8
9

IN THIS PAGE