On Jan 4, 12:11 pm, Andre Rothe <andre.ro...@[EMAIL PROTECTED]
>
wrote:
> Hi,
>
> Did anyone knows a database system which can execute the following
query:
>
> select *
> from (select rownum t, a, b, c, d from datatable where c=1 order by
a,b,c)
> where t=15
>
> In Oracle I get the 15th row of the subquery, but I cannot find another
> system which has implemented the rownum functionality like Oracle.
>
> Ideas?
FYI, DB2 V9.5 has a compability mode that you can enable to ease
****ting from Oracle. However, it is much better to use standard sql to
express the same thing:
select * from (
select row_number() over (order by a,b,c) as t, a,b,c,d from
datatable
where c=1
) as X where t=15
The name of the subquery is not necessary according to the standard,
but DB2 (V9) requires it.
HTH
/Lennart


|