|
Contact me sending an e-mail (antispam defense activated) |
Title: Limit the number of rows returned
Author: Sandro Tosi
Last modified: 2005-11-23
A big table, you'd like to take only a slice of it: how to do? Use
LIMIT keyword.
Syntax is LIMIT <start_row>,<row_count> : it will limit the number of
rows returned to <row_count> and starts returning rows from the
<start_row>-th record in the table.
mysql> SELECT * FROM big_table
-> LIMIT 0,10;
that will take the first 10 rows of big_table (the first rows is
numbered 0).
mysql> SELECT * FROM big_table
-> LIMIT 10,10;
will take the next 10 rows from the same table, |