On 3 Aug., 21:10, Thomas Mueller <[email protected]> wrote:
> I don't think it's incorrect. It matches the documentation, and as far
> as I know it works like Oracle.

Right, this is exactly the way Oracle's ROWNUM behaves (although in
Oracle it's not a function, so ROWNUM() does not work),

> "Row_Number() Over (Order By SalesOrderID)" - H2 doesn't support this
> yet. But as more and more databases support it, it would be a good
> idea to support it in H2 as well. As far as I know, Derby support
> ROW_NUMBER() OVER() in the latest version, which is basically the same
> as ROWNUM().

The row_number() is a so called "windowing functions" and behaves
completely different to Oracle's ROWNUM. Especially because you can
have the row_number() on only a part of the result set (using
partition by) and maybe a different sort order than the base select
(using order by in the over() clause).

Oracle also supports windowing functions (called analytical functions)
and thus also supports row_number().

To my knowledge only Oracle and Postgres support a more or less
complete set of ANSI windowing functions. SQL Server only supports
row_number(), rank() and dense_rank().

Derby does not support the full syntax for windowing functions as it
lacks the "partition by" and "order by" for the over() clause. so itss
row_number() cannot really be compared to Oracle's, Postgres' or SQL
Server's row_number()


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