11 MySQL Tutorial for Beginners: The LIMIT Clause

preview_player
Показать описание
The LIMIT clause limits the number of rows in the result set.
In its simplest form, you code the LIMIT clause with a single numeric argument.
If you code a single argument, it specifies the maximum row count, beginning with the first row. If you code two arguments in a LIMIT clause, the first one represents the starting point for the result set, also called the "offset".
This "offset" starts to count from a value of zero. This means that zero refers to the first row in the result set, one to the second, two to the third and so on.

SELECT, FROM, WHERE, ORDER BY, and LIMIT are the five main clauses of the SELECT statement but only the SELECT clause is required.
When you code the SELECT clause, you should include only the columns you really need (for example, you shouldn't code an asterisk to retrieve all the columns unless you need all the columns).
That's because the amount of data that's retrieved can affect system performance.
That goes for retrieving rows too. The fewer rows you retrieve, the more efficient the statement will be.
Because of that, you typically include a WHERE clause on your SELECT statements with a search condition that filters the rows in the base table so only the rows you need are retrieved

EXERCISES for your SELF-TRAINING:

SCRIPT FOR THE EXAMPLES:

SUBSCRIBE!

FACEBOOK

GOOGLE+
Рекомендации по теме
visit shbcf.ru