LIMIT:
Example:
The LIMIT is used to specify the maximum number of rows to return from object.
Syntax:
SELECT fieldList FROM objectType [WHERE conditionExpression] LIMIT number_of_rows
Example:
This query returns the first 100 Account records whose Industry is Media.
SELECT Name FROM Account WHERE Industry = 'Media' LIMIT 100
You can use LIMIT with count() as the fieldList to count up to the maximum specified. But You can't use a LIMIT clause in a query that uses an aggregate function.