- MySQL 8 for Big Data
- Shabbir Challawala Jaydip Lakhatariya Chintan Mehta Kandarp Patel
- 234字
- 2021-08-20 10:06:13
LIMIT clause
Using LIMIT clause we can retrieve only some amount of rows from the large data chunks. It helps to limit the number of rows returned as a result set. Suppose there are thousands of rows exists in a table but we require only 10 records then this clause helps to fetch only 10 records instead of fetching thousands of records. This really helps to tune the performance while searching on large datasets.
We can pass either one or two arguments with the LIMIT clause. In case of two arguments, one will be an offset which specifies the offset of the first row to return. While the second argument will be count which specifies the maximum number of rows to be returned. This both argument should be zero or in a positive manner. Check the below query where we have fetched rows from the user table starting from the 5th row up to the 10 records.
SELECT * FROM users limit 5 , 10;
If we specify only one argument with the LIMIT clause then the argument will be considered as the number of rows. For example, the following query is used to retrieve 10 rows from the users table:
SELECT * FROM users limit 10;
As of now, we have seen retrieving data from a single table; if we want to retrieve data from multiple tables, JOIN and UNION keywords are used.
- Learning Neo4j
- C++ Primer習題集(第5版)
- Web前端開發技術:HTML、CSS、JavaScript(第3版)
- Python 深度學習
- 基于Java技術的Web應用開發
- 自制編程語言
- Android程序設計基礎
- C語言程序設計實驗指導 (第2版)
- 大話Java:程序設計從入門到精通
- Scratch·愛編程的藝術家
- Building Serverless Architectures
- Access 2010數據庫應用技術實驗指導與習題選解(第2版)
- IBM Cognos TM1 Developer's Certification guide
- MongoDB Cookbook(Second Edition)
- OpenStack Sahara Essentials