LIMIT分句用于限制最终结果集的行数。LIMIT ALL和略去LIMIT分句的结果一样。以下示例为查询一个大表,LIMIT子句限制它只输出5行。
SELECT orderdate FROM orders LIMIT 5;o_orderdate------------- 1996-04-14 1992-01-15 1995-02-01 1995-11-12 1992-04-26(5 rows)
SELECT orderdate FROM orders LIMIT 5;
o_orderdate
-------------
1996-04-14
1992-01-15
1995-02-01
1995-11-12
1992-04-26
(5 rows)