Output modifiers
Output modifiers can be used to order records in the query result and to define the items to return.
These output modifiers can be used anywhere in a query.
ORDER BY
The ORDER BY clause is used to order records in an array. By default
the order is ascending, but you can specify ASC or
DESC. The keyword should be followed by a simple or conditional
expression, and you can add several comma-separated parameters in the ORDER
BY clause. For
example:
ORDER BY expression_1 DESC, expression_2
LIMIT
The LIMIT clause allows you to define a maximum number of elements to
return in the query result. The keyword should be followed by an integer or by a simple
or conditional expression that returns an
integer.
LIMIT expression
OFFSET
The OFFSET clause allows you to discard a number of elements at the
beginning of the query result. The keyword should be followed by an integer or by a
simple or conditional expression that returns an
integer
OFFSET expression