db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean T. Anderson" <...@bristowhill.com>
Subject Re: How to select top n record
Date Tue, 03 Jan 2006 18:22:03 GMT
Legolas Woodland wrote:
> Geert Bevin wrote:
>>Hi Legolas,
>>afaik Derby has no SQL statement for this, you can use JDBC to get the
>>same effect though through the statement.setFetchSize(limit) and
>>statement.setMaxRows(max_rows) methods.
>> ...  
> Hi , Thank you for reply.
> unfortunately i do not use JDBC directly and i use Rowsets and Data 
> provider from Sun java studio creator.
> so i should consider limiting total number of rows that a command return 
> in Database itself..
> another reason that I'm looking for sql syntax for *selecting an offset 
> of records* , *ton n *, *top n%* record is that this application has to 
> be very optimized.
> Now that holiday is finished and all people engaged with Derby is here i 
> reply again.
> i hope some on know about this issue.

Derby SQL doesn't support "TOP N" nor "LIMIT".

As Geert mentioned, the way Derby supports limiting the number of rows 
returned is through the standard JDBC java.sql.Statement.setMaxRows() 

I don't spot in Jira that anyone has formally requested this 
functionality for Derby, so feel free to file an enhancement request. 
Tips on how to do so are at 
http://db.apache.org/derby/DerbyBugGuidelines.html .



View raw message