LIMIT Clause
LIMIT n, m
allows to select the m
rows from the result after skipping the first n
rows. The LIMIT m OFFSET n
syntax is equivalent.
and m
must be non-negative integers.
If there is no ORDER BY clause that explicitly sorts results, the choice of rows for the result may be arbitrary and non-deterministic.
The number of rows in the result set can also depend on the setting.
When you set WITH TIES
modifier for LIMIT n[,m]
and specify ORDER BY expr_list
, you will get in result first n
or rows and all rows with same ORDER BY
fields values equal to row at position n
for LIMIT n
and m
for LIMIT n,m
.
This modifier also can be combined with ORDER BY … WITH FILL modifier.
returns
but after apply modifier
it returns another rows set