From the help file:
Adaptive Server Anywhere SQL User's Guide
7. Summarizing, Grouping and Sorting Query Results
The ORDER BY clause: sorting query results
Retrieving the first few rows of a query
You can limit the results of a query to the first few rows returned using
the FIRST or TOP keywords. While you can use these with any query, they are
most useful with queries that use the ORDER BY clause.
Examples
The following query returns information about the first employee sorted by
last name:
SELECT FIRST *
FROM employee
ORDER BY emp_lname
The following query returns the first five employees sorted by last name
comes earliest in the alphabet:
SELECT TOP 5 *
FROM employee
ORDER BY emp_lname
Restrictions on use of FIRST and TOP
FIRST and TOP are supported in the outermost SELECT block of a request. They
should be used only in conjunction with an ORDER BY clause to ensure
consistent results. FIRST is also supported in a subqueries that are either
in a query's SELECT list, or are involved in a comparison predicate-the
subquery is not part of a quantified predicate involving IN, ANY, SOME, or
ALL.
For example, the nested query
SELECT *
FROM sales_order_items
WHERE prod_id = (SELECT FIRST from product)
is supported, whereas
SELECT *
FROM sales_order_items
WHERE prod_id = ANY(SELECT FIRST from product)
is not.
Unsupported instances of FIRST or TOP n may not trigger a syntax error, but
will likely yield unexpected or unpredictable results. For this reason you
should refrain from using FIRST or TOP in SQL constructs other than the two
mentioned above. Specifically you should not specify FIRST or TOP in a
derived table, view, or quantified subquery.