Pgsql的offset可以通過以下替代方案實(shí)現(xiàn):
SELECT * FROM (
SELECT *, ROW_NUMBER() OVER () AS rn
FROM table_name
) AS foo
WHERE rn > 10;
DECLARE cur CURSOR FOR
SELECT *
FROM table_name
OFFSET 10;
FETCH NEXT FROM cur;
SELECT *
FROM table_name
WHERE id > 10
LIMIT 10;
這些替代方案可以幫助實(shí)現(xiàn)offset的功能,但可能會(huì)對性能產(chǎn)生一定影響,需要根據(jù)具體情況選擇合適的方法。