A newer version of this documentation is available.

View Latest

LIMIT clause

LIMIT expression

The LIMIT clause specifies the maximum number of objects that can be returned in a result set by SELECT. This clause must have a non-negative integer as its upper bound.

Name and age list: limit by 2

SELECT fname, age
     FROM tutorial
          ORDER BY age
              LIMIT 2

Returns:

 {
   "results": [
     {
       "age": 18,
       "fname": "Fred"
     },
     {
       "age": 20,
       "fname": "Harry"
     }
   ]
 }