MySQL

MySQL LIMIT

LIMIT keyword is used to limit the number of rows returned in the result of a query. It can be used in conjunction with SELECT, UPDATE, OR DELETE statements.

Let’s take a few examples of how LIMIT keyword is used to see how it works. For this, we will use “Clients” table.
 

 

 

Example 1:

The following query returns the first 2 rows of the “Clients” table:

SELECT * FROM Clients LIMIT 2;


 

Example 2:

The following query returns a range from the “Clients” table (starting from record 2, returns the next 4 rows):

SELECT * FROM Clients LIMIT 2,4;


 

mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *