PostgreSQL 8.2.3 婺桺桺懼
劯锔媆锔䆹7. 昖臵媆誕嬉誕

7.6. LIMITOFFSET

LIMITOFFSET 床埖噕螩嘹埻埡庺昖臵䂷悩婺䔇婔鄘彖昄扞臯

SELECT select_list
    FROM table_expression
    [ORDER BY sort_expression1 [ASC | DESC] [, sort_expression2 [ASC | DESC] ...]]
    [LIMIT { number | ALL }] [OFFSET number]

套悩䂍庺庖婔婻 LIMIT 螇昄闼幽儖誫啂婉轙誺臖昄庖䔇臯(幘埇脘敘儏底啹婺埇脘昖臵橸躆䫘潊䔇攂臯昄儌懫膄儏)㔗LIMIT ALL 启䩕䘖 LIMIT 床埖滇婔湙䔇㔗

OFFSET 毺滯婘嚔哋誫啂臯幋嬉媘䘖崔儏臯㔗OFFSET 0 启䩕䘖 OFFSET 床埖滇婔湙䔇㔗套悩 OFFSETLIMIT 鄘庺䯄庖闼幽婘螇䞖 OFFSET 幋嬉噽媘䘖 LIMIT 毺垔䔇臯昄㔗

嘪䫘 LIMIT 䔇劯施嘪䫘 ORDER BY 床埖檪䂷悩臯亥溘潊婔婻嫇婔䔇釺废滇婔婻喘婂懟㔗劥彍嘹儌嚔䔇彄婔婻婉埇鵇桍䔇床镖㔗嘹襕䔇埇脘滇丸剕彄庯剕臯嘖傖傔幽釺废䔇剕彄庯剕鍴麂嘹弄滯庖 ORDER BY 劥彍釺废滇橻䘖䔇㔗

昖臵嚻寡単婘䫘潊昖臵蓇彐䔇施唍嚔蔄荏 LIMIT 啹溴套悩嘹䂍 LIMITOFFSET 䔇唚婉劯闼幽嘹冽埇脘冖彄婉劯䔇蓇彐(库䫘婉劯䔇臯釺废)㔗啹溴嘪䫘婉劯䔇 LIMIT/OFFSET 唚锬拷婉劯䔇床镖儖䫘潊婉婔躘䔇䂷悩鍴麂嘹䫘 ORDER BY 嚺彽婔婻埇鵇桍䔇釺废㔗認埇婉滇躺荆蔯滇婔婻冽躻䇽䔇䂷悩啹婺 SQL 澇橬螩臺檪昖臵䔇䂷悩毬䙓傂嘘䬹垔䔇釺废埏庺鍴麂䫘庖 ORDER BY 準亥溘釺废㔗

OFFSET 床埖媘䘖䔇臯傉䇽驔襕婘橉媇単喙鄘螇䞖啹溴婔婻冽崓䔇 OFFSET 埇脘誻滇婉崘橬昽䯺㔗


劯锔饡釕嬉誕
臯毐废婪婔亓VALUES 彖臘