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:

    Do we honestly believe that hopeless kids growing up under the harsh new rules will turn out to be chaste, studious, responsible adults? On the contrary, by limiting welfare, job training, education and nutritious food, won’t we plant the seeds for another bumper crop of out-of-wedlock moms, deadbeat dads and worse?
    Richard B. Stolley (20th century)

    Nature never rhymes her children, nor makes two men alike. When we see a great man, we fancy a resemblance to some historical person, and predict the sequel of his character and fortune, a result which he is sure to disappoint. None will ever solve the problem of his character according to our prejudice, but only in his high unprecedented way.
    Ralph Waldo Emerson (1803–1882)

    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)