- 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 Spring 5.0
- JavaScript 網(wǎng)頁編程從入門到精通 (清華社"視頻大講堂"大系·網(wǎng)絡開發(fā)視頻大講堂)
- 名師講壇:Java微服務架構實戰(zhàn)(SpringBoot+SpringCloud+Docker+RabbitMQ)
- Unreal Engine 4 Shaders and Effects Cookbook
- Visual Foxpro 9.0數(shù)據(jù)庫程序設計教程
- 基于SpringBoot實現(xiàn):Java分布式中間件開發(fā)入門與實戰(zhàn)
- Java程序員面試筆試寶典(第2版)
- 零基礎學C語言第2版
- Java程序設計與項目案例教程
- JavaScript從入門到精通(視頻實戰(zhàn)版)
- Kotlin進階實戰(zhàn)
- Python第三方庫開發(fā)應用實戰(zhàn)
- IBM RUP參考與認證指南
- 基于MATLAB的控制系統(tǒng)仿真及應用
- Unity 3D UI Essentials