asked 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.

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.

answered
User Byron Coetsee
by
8.6k points