db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amir Michail" <amich...@gmail.com>
Subject Re: getting first k rows from a query that satisfy some additional condition
Date Mon, 27 Oct 2008 18:55:43 GMT
On Mon, Oct 27, 2008 at 1:14 PM, Amir Michail <amichail@gmail.com> wrote:
> Hi,
>
> What is a good way for efficiently getting the first k rows from a
> query that also satisfy some additional condition to be determined
> using Java code?

BTW, even without this condition, the following approach is slow:

SELECT * FROM (
   SELECT
     ROW_NUMBER() OVER () AS R,
     T.*
   FROM T
) AS TR
   WHERE R <= 10;

Amir

>
> Amir
>
> --
> http://chatbotgame.com
> http://numbrosia.com
> http://twitter.com/amichail
>



-- 
http://chatbotgame.com
http://numbrosia.com
http://twitter.com/amichail

Mime
View raw message