Hi,

I've seen the documentation that states: "...The first row has the row
> number 1, and is calculated before ordering and grouping the result
> set, but after evaluating index conditions (even when the  index
> conditions are specified in an outer query)".
>
> What does it mean exactly?


It means the condition from the outer query might be moved to the inner
query, which can break some use cases for ROWNUM().

How can i make the first query return the
> expected value for R.
>

One solution might be to make sure no index can be used, for example
using WHERE
-SEGKEY=-55

To me it seems very illogical that ROWNUM() behaves so differently
> depending on what the WHERE clause is. I would expect the inner query
> to give back a set of values that does not change when copied into the
> main result.
>

That would be bad for performance for the normal case (where ROWNUM() isn't
used).

Regards,
Thomas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" 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/h2-database?hl=en.

Reply via email to