>>>>>>>>>>>> David Van Couvering wrote (2007-05-14 13:11:00): > Thanks for the tip, Bernt, but I must humbly say "yuck!" to the syntax. > > OK, getting over that, it's pretty worthless to me given that Derby > doesn't use it and Derby is the primary DB used by NetBeans. But > let's say it was implemented -- would it work with a result set that > is a join across multiple tables? I can't tell from the convoluted > syntax...
I have never used it myself, but assume it would be something like
this:
SELECT * FROM (
SELECT
ROW_NUMBER() OVER (ORDER BY key ASC) AS rownumber,
columns
FROM (
SELECT however complex query you want......
) AS bar
) AS foo
WHERE rownumber <= n
--
Bernt Marius Johnsen, Database Technology Group,
Staff Engineer, Technical Lead Derby/Java DB
Sun Microsystems, Trondheim, Norway
signature.asc
Description: Digital signature
