RE: ROWNO

"Zabach, Elke" <[email protected]>
Newsgroups gmane.comp.db.sapdb.general
Message-ID <[email protected]>
Slawomir Latka wrote:
 
> Can anybody tell me how can I replace this statement
> select * from (select SUBQ.*,ROWNO ROW_NUM FROM 
> 
> (SELECT * FROM COUNTRIES) SUBQ WHERE ROWNO <= 10 ORDER BY ROW_NUM DESC) 
> 
> WHERE ROWNO <= 5 ORDER BY ROW_NUM ASC
> 
>  
> wich works in Oracle,
> to have the result in sapdb. It doesn't work, because "order by" 
> statement can't be used in subquery!
> In this exmple, I would like to get 5 records down starting at position number 10.

Are we talking about
 
select * from
    (select *, rownum row_num from countries where rownum <= 10) subq
where row_num >= 6
 
?
 
Elke
SAP Labs Berlin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.