9.18. 栋ㄧ计

セ竊磞瓃êㄇ︽ㄧ计ヘ玡硂摸ㄧ计Τ腹ネΘㄧ计  Table 9-38 ┮瓃

Table 9-38. 腹ネΘㄧ计

ㄧ计把计摸摸磞瓃
generate_series(start, stop)intbigintsetof intsetof bigint 籔把计摸 ネΘ计眖 startstop˙秈
generate_series(start, stop, step)int or bigintsetof int or setof bigint (same as argument type) ネΘ计眖 startstop˙秈 step

狦 step 琌タ计τ start  stop ê或箂︽稱猭狦 step 琌璽计start  stop 玥箂︽狦琌 NULL 块玻ネ箂︽step 箂玥琌岿粇 琌ㄇㄒ

select * from generate_series(2,4);
 generate_series
-----------------
               2
               3
               4
(3 rows)

select * from generate_series(5,1,-2);
 generate_series
-----------------
               5
               3
               1
(3 rows)

select * from generate_series(4,3);
 generate_series
-----------------
(0 rows)

select current_date + s.a as dates from generate_series(0,14,7) as s(a);
   dates
------------
 2004-02-05
 2004-02-12
 2004-02-19
(3 rows)