- PostgreSQL Development Essentials
- Manpreet Kaur Baji Shaik
- 148字
- 2021-07-14 10:00:55
Using the LIMIT clause
The LIMIT
clause is used to retrieve a number of rows from a larger data set. It helps fetch the top n records. The LIMIT
and OFFSET
clauses allow you to retrieve just a portion of the rows that are generated by the rest of the query from a result set:
SELECT select_list FROM table_expression [LIMIT { number | ALL }] [OFFSET number]
If a limit count is given, no more than that many rows will be returned (but possibly fewer, if the query itself yields fewer rows). LIMIT ALL
is the same as omitting the LIMIT
clause.
The OFFSET
clause suggests skipping many rows before beginning to return rows. OFFSET 0
is the same as omitting the OFFSET
clause. If both OFFSET
and LIMIT
appear, then the OFFSET
rows will be skipped before starting to count the LIMIT
rows that are returned.
推薦閱讀
- 一步一步學Spring Boot 2:微服務項目實戰
- Pandas Cookbook
- Dependency Injection in .NET Core 2.0
- 青少年美育趣味課堂:XMind思維導圖制作
- Android 7編程入門經典:使用Android Studio 2(第4版)
- 假如C語言是我發明的:講給孩子聽的大師編程課
- Spring快速入門
- Access 2010數據庫應用技術(第2版)
- 微課學人工智能Python編程
- Illustrator CS6設計與應用任務教程
- Android Development Tools for Eclipse
- Maven for Eclipse
- 人人都能開發RPA機器人:UiPath從入門到實戰
- Node.js應用開發
- Java 11 and 12:New Features