My research shows that ROW_NUMBER() OVER (ORDER BY <somecol>) is the  
standard SQL approach to producing the LIMIT/OFFSET functions, which  
is from this article:

        http://troels.arvin.dk/db/rdbms/#select-limit

I used to use the "select rownum directly" approach you've outlined  
below, but the three levels of subquery are less than ideal and I have  
vague recollections of other issues arising with "rownum" not always  
being available, coming out as NULL, etc.

What I need for the ticket is an example which illustrates LIMIT/ 
OFFSET passing for a DB which supports simple LIMIT/OFFSET keywords  
such as SQLite, but fails for our Oracle approach.


On Mar 25, 2008, at 2:51 PM, vkuznet wrote:

>
> Hi,
> I reported a bug #536 almost a year ago, but looks like it didn't
> catch too much attention within new 0.4 branch. I want to revise it.
> The problem only occur in ORACLE instance where someone want to do
> pagination and select distinct rows in chunks. The correct way to do
> this in ORACLE is the following:
>
> select * from (SELECT x.*, rownum as rnum FROM (query) x) where rnum
> between min and max;
>
> For those who are interesting this link provides full discussion.
> http://progcookbook.blogspot.com/2006/02/using-rownum-properly-for-pagination.html
>
> Thank you,
> Valentin.
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to