...

/

Limit the Number of Resulting Records

Limit the Number of Resulting Records

Learn how to retrieve required rows and limit them.

We'll cover the following...

Sometimes, we want to return the first row that matches the select criteria, even if more rows might match. We can do that using the limit at the end of the select statement. For example, let’s suppose that we want to get the most expensive product in our catalog. This is returned with the following select statement:

 ...