MAXROWS
In v20.3+, use the MAXROWS clause to retrieve a maximum of N results, applied after any filters.
Syntax
Section link for SyntaxSELECT {fields}
FROM {query target}
MAXROWS {number}Query Examples
Section link for Query ExamplesThe following are examples of queries using MAXROWS.
Query: Retrieve a Maximum of N Documents
Section link for Query: Retrieve a Maximum of N DocumentsThe following query returns a maximum of 500 documents:
SELECT id
FROM documents
MAXROWS 500Query: Use MAXROWS with PAGESIZE
Section link for Query: Use MAXROWS with PAGESIZEWhen used with the PAGESIZE clause, the MAXROWS clause must come first. The following query returns a maximum total of three (3) documents with one (1) result per page:
SELECT username__sys
FROM user__sys
MAXROWS 3
PAGESIZE 1