Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer SQL Top and Limit | Filtering Statements
SQL Tutorial for Beginners
Sectie 3. Hoofdstuk 9
single

single

SQL Top and Limit

Veeg om het menu te tonen

TOP and LIMIT statements determine the amount of records in the result. For example, you want to limit the result with 7 records. In MS SQL and PostgreSQL, use the LIMIT keyword at the end of the query:

1234
--Find top-3 the eldest songs SELECT title, year FROM songs ORDER BY year LIMIT 3

In MySQL syntax, use TOP keyword with select to limit the number of output rows. You can also set a percentage: SELECT TOP 50 PERCENT.

During this course we will use the LIMIT statement.

Taak

Veeg om te beginnen met coderen

Find 5 first albums and their singers, which are sorted by naming, and return the result. Choose only albums from the 1970s.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 3. Hoofdstuk 9
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

some-alt