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:

    There could be no fairer destiny for any physical theory than that it should point the way to a more comprehensive theory in which it lives on as a limiting case.
    Albert Einstein (1879–1955)

    By intervening in the Vietnamese struggle the United States was attempting to fit its global strategies into a world of hillocks and hamlets, to reduce its majestic concerns for the containment of communism and the security of the Free World to a dimension where governments rose and fell as a result of arguments between two colonels’ wives.
    Frances Fitzgerald (b. 1940)

    Over the low, barnacled, elephant-colored rocks,
    Come the first tide-ripples, moving, almost without sound, toward
    me,
    Running along the narrow furrows of the shore, the rows of dead clam shells;
    Theodore Roethke (1908–1963)