db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Noll <dan...@nuix.com>
Subject Re: top N reporting with derby
Date Thu, 15 May 2008 03:09:19 GMT
On Thursday 15 May 2008 01:12:21 Six Fried Rice wrote:
> You can write your query like this:
>
> SELECT ROW_NUMBER() OVER() as rownum, spool_table.* FROM spool_table
> ORDER BY date_inserted WHERE rownum <= 100
>
> And it should do the trick. This requires Derby 10.4.

This is quite interesting.  Is there also a way to do this if you need to join 
to another table, such that it selects rows 100 to 200 of the first table 
before doing the join to the second?

Daniel

Mime
View raw message