- 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.
- The Complete Rust Programming Reference Guide
- Effective C#:改善C#代碼的50個有效方法(原書第3版)
- JavaScript從入門到精通(第3版)
- C語言程序設計
- Python深度學習:基于TensorFlow
- C# 8.0核心技術指南(原書第8版)
- Java Web開發就該這樣學
- TMS320LF240x芯片原理、設計及應用
- 詳解MATLAB圖形繪制技術
- Hands-On Full Stack Development with Spring Boot 2.0 and React
- Julia 1.0 Programming Complete Reference Guide
- Python 3.7從入門到精通(視頻教學版)
- Illustrator CS6設計與應用任務教程
- 愛上C語言:C KISS
- Keil Cx51 V7.0單片機高級語言編程與μVision2應用實踐