db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raghunath <raghu.na...@gmail.com>
Subject Doubt in ROW_NUMBER function
Date Mon, 23 Jun 2008 14:44:04 GMT
Hi,

I need a query to restrict the row count in derby. luckily it got
implemented in derby 10.4.1.3 but there are few limitations.

one of the limitations as follows..
-------
http://db.apache.org/derby/docs/dev/ref/rreffuncrownumber.html
the above doc is saying, *we cant use where clause along with ROW_NUMBER
function *

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

====================
----------------------

But I modified the query to en-corporate where clause..It's still working
fine with where clause.
*SELECT * FROM (
   SELECT
     ROW_NUMBER() OVER () AS R,
     g.*
   FROM (select * from APP.CHANNEL where id>294912 ) as g
) AS TR
   WHERE R <= 10;

*
My doubt is , is there any performance hit ?
please clarify my doubt...


Thanks
Raghunath N
if u never failed, u never lived ...

Mime
View raw message