db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amit Modi <amit_m...@persistent.co.in>
Subject Re: select: limit # of rows returned
Date Thu, 11 Aug 2005 05:09:40 GMT
Daniel Tripp wrote:

> Hello.  I'm trying to limit the number of rows returned by a select 
> statement.  I know that other databases have way to do this, such as:
>  
> select * top 10 from thetable
>  
> set rowcount 5
> select * from thetable
>  
> select * from thetable limit 10
>  
> But I gather that these are particular to MySQL / MS SQL / whatever.  
> Done anyone know of a way that this can be done with Derby?
>  
>  

Hi Daniel,
    I was having same situation in my project,
    I have one solution which works quite well, not very sure whether it 
is proper or not,
    You can set max count on the java.sql.Statement object in java.
And once you have set, then execute the query.

Hope this will solve your problem.

Regards:
Amit Modi

Mime
View raw message