db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Legolas Woodland <legola...@gmail.com>
Subject Re: How to select top n record
Date Tue, 03 Jan 2006 16:56:10 GMT
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.
>
> However, since you're a RIFE user, you can just use our Select query
> builder and use the limit and offset methods there. RIFE will handle
> all this for you in the background transparently:
> http://rifers.org/docs/api/com/uwyn/rife/database/queries/Select.html#limit(int)
>
> Best regards,
>
> Geert
>   

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.

Thank you

> On 12/26/05, Legolas Woodland <legolas.w@gmail.com> wrote:
>   
>> Hi
>> Thank you for reading my post.
>> how i can select top n record of a table ?
>> i tried
>> Select Top 10 from Leg //not works
>> select *from leg limit 10 //not works
>> ....
>>
>>
>> is there any syntax in derby sql for selecting top n , or an offset of a
>> table ?
>>
>>     
>
>
> --
> Geert Bevin                       Uwyn bvba
> "Use what you need"               Avenue de Scailmont 34
> http://www.uwyn.com               7170 Manage, Belgium
> gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03
>
> PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
> Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net
>
>   


Mime
View raw message