Between Symmetric
PostgreSQL's between
construct allows you to make a comparison between two values (numbers, timestamps, etc.).
If you supply an empty range by using the larger of the two values first, an empty set will result.
Tacking symmetric
onto the between
construct is one way to avoid this issue.
BETWEEN SYMMETRIC is the same as BETWEEN except there is no requirement that the argument to the left of AND be less than or equal to the argument on the right. If it is not, those two arguments are automatically swapped, so that a nonempty range is always implied.
PreviousFind Records That Contain Duplicate ValuesNextDifference Between Explain And Explain Analyze
Last updated