From the course: From Excel to SQL

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Limiting results in SQL

Limiting results in SQL

From the course: From Excel to SQL

Start my 1-month free trial

Limiting results in SQL

- So generally when you first start executing SQL queries it's pretty normal to let the database return all the rows of results that it has available. And when you're working with a small data set like we have in these examples, then the database isn't going to have a problem returning a few hundred rows or even a few thousand. But if you're working with a database table that stores millions of rows, this isn't going to work so well. Requesting all that data can have a performance impact on the database and how quickly your results are returned. Think of it this way, when you do a search on Google it's only showing you the first 10 results even though there are thousands of possible results it could show you. It controls the number of results that you see. So to reduce the number of rows of data that is returned for your queries, you can use the limit keyword. Let's head over to DB Browser and have a look at how you can…

Contents