forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
12 KiB
12 KiB
Range Functions
lower(anyrange)
Description: Lower bound of range
Return type: Range's element type
Example:
1 2 3 4 5 | SELECT lower(numrange(1.1,2.2)) AS RESULT; result -------- 1.1 (1 row) |
upper(anyrange)
Description: Upper bound of range
Return type: Range's element type
Example:
1 2 3 4 5 | SELECT upper(numrange(1.1,2.2)) AS RESULT; result -------- 2.2 (1 row) |
isempty(anyrange)
Description: Is the range empty?
Return type: boolean
Example:
1 2 3 4 5 | SELECT isempty(numrange(1.1,2.2)) AS RESULT; result -------- f (1 row) |
lower_inc(anyrange)
Description: Is the lower bound inclusive?
Return type: boolean
Example:
1 2 3 4 5 | SELECT lower_inc(numrange(1.1,2.2)) AS RESULT; result -------- t (1 row) |
upper_inc(anyrange)
Description: Is the upper bound inclusive?
Return type: boolean
Example:
1 2 3 4 5 | SELECT upper_inc(numrange(1.1,2.2)) AS RESULT; result -------- f (1 row) |
lower_inf(anyrange)
Description: Is the lower bound infinite?
Return type: boolean
Example:
1 2 3 4 5 | SELECT lower_inf('(,)'::daterange) AS RESULT; result -------- t (1 row) |
Parent topic: Range Functions and Operators