PostgreSQL SyntaxLesson 21Free preview
PostgreSQL LIMIT
This lesson is part of PostgreSQL · All levels
Summary
LIMIT limits the number of rows returned by the query, which is very useful for viewing data clips or building a page view. Packed with OFFSET, you can skip a number of lines to make a pagination. PostgreSQL also recognizes the FETCH FIRST standard syntax as a LIMIT matching.
Key points
- Limit n limits the result to a maximum of n lines.
- OFFSET missed a number of lines before the results were taken.
- FETCH FIRST n ROWS ONLY is a syntax matching SQL standard.
- Without ORDER BY, the lines taken are not guaranteed to be the same.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.