lbehnke / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

ROWNUM: Oracle compatibility when used within a subquery. #198

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The ROWNUM function is not completely compatible with Oracle. Example:

drop table test;
create table test(id int primary key, name varchar(255));
insert into test values(1, 'One');
insert into test values(2, 'Two');
insert into test values(3, 'Three');
select rownum, id, name from test;

select * from (select rownum r, id, name from test) 
where r between 2 and 3;
-- compatible

select * from (select rownum, id, name from test) 
where id = 2;
-- incompatible

Original issue reported on code.google.com by thomas.t...@gmail.com on 15 May 2010 at 3:42

GoogleCodeExporter commented 9 years ago

Original comment by thomas.t...@gmail.com on 28 Jun 2010 at 6:40