- 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.
推薦閱讀
- Java入門經典(第6版)
- SQL學習指南(第3版)
- 造個小程序:與微信一起干件正經事兒
- 精通軟件性能測試與LoadRunner實戰(第2版)
- WordPress Plugin Development Cookbook(Second Edition)
- FFmpeg入門詳解:音視頻原理及應用
- ASP.NET 3.5程序設計與項目實踐
- Drupal 8 Configuration Management
- Spring Boot+MVC實戰指南
- Azure Serverless Computing Cookbook
- Python Deep Learning
- LabVIEW數據采集
- Python GUI Programming Cookbook(Second Edition)
- MongoDB Administrator’s Guide
- 你必須知道的.NET(第2版)