9.25. 集合回傳函數
本節描述可能傳回多筆資料集合的函數。 此類別中使用最廣泛的函數是數列生成函數,如 Table 9.65 和 Table 9.66 所示。 其他更詳細的集合回傳函數在本手冊的其他章節也有說明。有關組合多個集合回傳函數的方法,請參閱第 7.2.1.4 節。
Table 9.65. Series Generating Functions
Function Description |
產生從 start 到 stop 的一系列數值,間隔為 step,其預設為 1。 |
產生從 start 到 stop 的一系列數值,間隔為 step。在 with time zone 的時候,一天中的時間和夏令時調整是根據 timezone 參數指定的時區或目前 TimeZone 設定(如果省略的話)所計算的。 |
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.66. 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