提取当前位置后的第x行

最近更新时间: 2025-02-18 16:02:00

  • 复制
    复制成功
postgres=#  FETCH ABSOLUTE 1 from tbase_cur ; 
 id |  nickname   
----+-------------
  1 | hello TDSQL PG
(1 row)
postgres=# FETCH RELATIVE 2 from tbase_cur ;
 id | nickname  
----+-----------
  3 | TDSQL PG好
(1 row)
postgres=# FETCH RELATIVE 2 from tbase_cur ;
 id |  nickname  
----+------------
  5 | TDSQL PG swap
(1 row)

每提取一次数据,游标的位置都是会前行。