Back to Materialize

FETCH

doc/user/content/sql/fetch.md

123554 B
Original Source

FETCH retrieves rows from a query using a cursor previously opened with DECLARE.

Syntax

{{% include-syntax file="examples/fetch" example="syntax" %}}

Details

FETCH will return at most the specified count of available rows. Specifying a count of ALL indicates that there is no limit on the number of rows to be returned.

For SUBSCRIBE queries, FETCH by default will wait for rows to be available before returning. Specifying a timeout of 0s returns only rows that are immediately available.