db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amit Modi <amit_m...@persistent.co.in>
Subject Re: LIMIT clause in select query
Date Fri, 26 Aug 2005 15:39:49 GMT
Hi Mamta,
    Thanks for the reply. I know about using  the JDBC api 
java.sql.Statement.setMaxRows() to limit
the number of rows returned, but the problem here is it returns the top 
rows from the complete result.

But suppose I want 50 rows and that too from 51 to 100 from the complete 
result, cannot be achieved using
setMaxRows().
So can you suggest some solution for this situation?

-- 
Regards:
Amit Modi


Mamta Satoor wrote:

> Hi Amit,
>  
> There are couple threads on this issue. One of them can be found at
> http://mail-archives.apache.org/mod_mbox/db-derby-user/200508.mbox/%3c31D2B068A53CC4498A6D7F4EFB3DCEAB03FA9F@activexch.springboardtech.com%3e

> <http://mail-archives.apache.org/mod_mbox/db-derby-user/200508.mbox/%3c31D2B068A53CC4498A6D7F4EFB3DCEAB03FA9F@activexch.springboardtech.com%3e>
>  
> In short, Derby does not support LIMIT clause in the SELECT statement, 
> but alternatively, you can use JDBC api 
> java.sql.Statement.setMaxRows() to limit the number of rows returned.
>
> Mamta
>  
> On 8/26/05, *Amit Modi* <amit_modi@persistent.co.in 
> <mailto:amit_modi@persistent.co.in>> wrote:
>
>     Hi,
>
>        I want to use LIMIT clause in the select query, as I want specific
>     number of rows, and
>     the start point of the row can vary. So the LIMIT clause can work as
>     there are two parameters in it,
>     offset from where to start and number of rows.
>
>     When i tried the same with derby, it was not working as derby does
>     not
>     support LIMIT.
>     So is there anything equivalent in derby?
>
>     --
>     Regards:
>     Amit Modi
>
>
>
>



Mime
View raw message