On May 14, 12:22 pm, Rami Ojares <[email protected]> wrote:
> 14.5.2010 13:00, Thomas Kellerer kirjoitti:> On May 14, 11:40 am, Kerry 
> Sainsbury<[email protected]>  wrote:
>
> >> Sorry -- I don't know! I don't see much value in "rownum()" either. I've
> >> never needed or wanted to use it for anything.
>
> > What about things like: Get the third highest value :)
>
> select ordered_col
> from tbl
> where condition
> order by ordered_col desc
> limit 1 offset 2

Nice one :)

I think the problem with H2's implementation of the ROWNUM "feature"
is, that it doesn't work the same way as Oracle's rownum.

The following works in Oracle but not in H2.

select *
from (
  select some_col, order_col, rownum as row_number
  from (
    select some_col, order_col
    from some_table
    order by order_col
  )
)
where row_number = 3

Supporting ROWNUM as a feature gives me the impression this is for
Oracle compatibility, but apparently it is not ;)

-- 
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