LIMITing results
As you might notice, our database is quite large - about three thousand cars. Sometimes we need to limit our results so only a few rows will be displayed. It may be useful if we work with big data and want to check if our query is valid or when we want to find TOP-n observation based on some condition.
To limit the number of rows to be shown use the LIMIT n
statement. For example,
9
1
2
3
SELECT column1, column2
FROM table_name
LIMIT 5
123SELECT column1, column2 FROM table_name LIMIT 5
this query will return the first 5 rows from table_name
Завдання
Swipe to start coding
From the audi_cars
table extract the first 10 rows of model
, price
, mileage
columns.
Рішення
9
1
2
3
SELECT model, price, mileage
FROM audi_cars
LIMIT 10
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 1. Розділ 3
single
9
1
No query executed yet... |
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат