9.25. 集合回傳函數
本節介紹可以回傳多筆資料的函數。 此類中使用最廣泛的函數是序列生成函數,詳見 Table 9.64 和 Table 9.65。 還有其他更有用的集合回傳函數也描述在本手冊的其他地方。 請參閱第 7.2.1.4 節以了解組合多個集合傳回函數的方法。
Table 9.64. Series Generating Functions
Function Description |
Generates a series of values from |
Generates a series of values from |
When step
is positive, zero rows are returned if start
is greater than stop
. Conversely, when step
is negative, zero rows are returned if start
is less than stop
. Zero rows are also returned if any input is NULL
. It is an error for step
to be zero. Some examples follow:
Table 9.65. Subscript Generating Functions
Function Description |
Generates a series comprising the valid subscripts of the |
Generates a series comprising the valid subscripts of the |
generate_subscripts
is a convenience function that generates the set of valid subscripts for the specified dimension of the given array. Zero rows are returned for arrays that do not have the requested dimension, or if any input is NULL
. Some examples follow:
When a function in the FROM
clause is suffixed by WITH ORDINALITY
, a bigint
column is appended to the function's output column(s), which starts from 1 and increments by 1 for each row of the function's output. This is most useful in the case of set returning functions such as unnest()
.
Last updated