LIMIT

Limits the returned result set to the number specified:

mysql> select Score from Students LIMIT 3;
+-------+
| Score |
+-------+
|    98 |
|    88 |
|    64 |
+-------+
3 rows in set (0.00 sec)

 

 

Alternatively, the starting position can be specified (starting from 0):

mysql> select Score from Students LIMIT 4, 3;
+-------+
| Score |
+-------+
|    77 |
|    44 |
|    59 |
+-------+
3 rows in set (0.00 sec)

 

In this example, LIMIT 4, 3 specifies that the result set will be limited to 3 starting from the 5th result (in relation to the result set starting from 0)

Leave a Reply