9.19. 範圍函式及運算子
Last updated
Last updated
SeeSection 8.17for an overview of range types.
Table 9.50shows the operators available for range types.
Table 9.50. Range Operators
The simple comparison operators<
,>
,<=
, and>=
compare the lower bounds first, and only if those are equal, compare the upper bounds. These comparisons are not usually very useful for ranges, but are provided to allow B-tree indexes to be constructed on ranges.
The left-of/right-of/adjacent operators always return false when an empty range is involved; that is, an empty range is not considered to be either before or after any other range.
The union and difference operators will fail if the resulting range would need to contain two disjoint sub-ranges, as such a range cannot be represented.
Table 9.51shows the functions available for use with range types.
Table 9.51. Range Functions
Thelower
andupper
functions return null if the range is empty or the requested bound is infinite. Thelower_inc
,upper_inc
,lower_inf
, andupper_inf
functions all return false for an empty range.