70.3k views
5 votes
Let's say a query would generate an important volume of results. What would you need

to add to the query in order to retrieve only the 10 first results.

User Kiprainey
by
6.3k points

1 Answer

4 votes

Answer:

It depends on the type of database:

MySQL, Postgres: ... LIMIT 10

MS-SQL: SELECT TOP 10 ...

Oracle: WHERE ROWNUM<=10

Step-by-step explanation:

There is no single answer because the syntax is different across database vendors.

User Byron Coetsee
by
6.6k points