ROWNUM expression gives different results in H2 version 1.4.192 and 1.4.196
This script:
create table Tab1 (name VARCHAR2(320));
INSERT INTO Tab1(name) VALUES ('abc');
INSERT INTO Tab1(name) VALUES ('abc');
INSERT INTO Tab1(name) VALUES ('xyz');
INSERT INTO Tab1(name) VALUES ('xyz');
select name, rownum from Tab1 where name='xyz';
drop table Tab1;
In v1.4.192 returns
name rownum
xyz 1
xyz 2
In v1.4.196 returns
name rownum
xyz 3
xyz 4
Such behavior breaks logic of SQL select, when rownum is part of
expression, like:
select * from itemtable where <some condition> and ROWNUM < 10;
If table "itemtable" is big (thousand rows), query returns zero rows,
because all rows have rownum much bigger than 10 in h2 v1.4.196
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.