Derby doesn't have a rownum feature?
In oracle, I can select first 3 rows like the followings.
select * from a where rownum < 3
In here, they suggests like the followings. But it's tedious.
SELECT * FROM (
SELECT
ROW_NUMBER() OVER (ORDER BY key ASC) AS rownumber,
columns
FROM tablename
) AS foo
WHERE rownumber <= n