Select (SQL) - Limiting Result Rows

Limiting Result Rows

Often it is convenient to indicate a maximum number of rows that are returned. This can be used for testing or to prevent consuming excessive resources if the query returns more information than expected. The approach to do this often varies per vendor.

In ISO SQL:2003, result sets may be limited by using

  • cursors, or
  • By introducing SQL window function to the SELECT-statement

ISO SQL:2008 introduced the FETCH FIRST clause.

Read more about this topic:  Select (SQL)

Famous quotes containing the words limiting, result and/or rows:

    O wily painter, limiting the scene
    From a cacophony of dusty forms
    To the one convulsion,
    Thom Gunn (b. 1929)

    Fashionable women regard themselves, and are regarded by men, as pretty toys or as mere instruments of pleasure; and the vacuity of mind, the heartlessness, the frivolity which is the necessary result of this false and debasing estimate of women, can only be fully understood by those who have mingled in the folly and wickedness of fashionable life ...
    Sarah M. Grimke (1792–1873)

    Creatures that hang themselves up like an old rag, to sleep;
    And disgustingly upside down.
    Hanging upside down like rows of disgusting old rags
    And grinning in their sleep.
    Bats!
    —D.H. (David Herbert)