Database Reference
In-Depth Information
just like LIMIT 3,4 . So, the following two statements are functionally identi-
cal, and you can use whichever you are more comfortable with:
Input
SELECT prod_name
FROM products
LIMIT 10,2;
Input
SELECT prod_name
FROM products
LIMIT 2 OFFSET 10;
Note
When There Aren't Enough Rows The number of rows to retrieve specified in LIMIT
is the maximum number to retrieve. If there aren't enough rows (for example, you speci-
fied LIMIT 10,5 , but there were only 13 rows), MariaDB returns as many as it can.
Using Fully Qualified Table Names
The SQL examples used thus far have referred to columns by just the column
names. It is also possible to refer to columns using fully qualified names (using
both the table and column names). Look at this example:
Input
SELECT products.prod_name
FROM products;
This SQL statement is functionally identical to the first one used in this chap-
ter, but here a fully qualified column name is specified.
Table names, too, may be fully qualified, as seen here:
Input
SELECT products.prod_name
FROM crashcourse.products;
Once again, this statement is functionally identical to the one just used (assum-
ing, of course, that the products table is indeed in the crashcourse
database).
 
 
Search WWH ::




Custom Search