Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Databases General > Re: Rownum
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 6 Topic 3069 of 3234
Post > Topic >>

Re: Rownum

by Lennart <Erik.Lennart.Jonsson@[EMAIL PROTECTED] > Jan 4, 2008 at 05:33 AM

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
 




 6 Posts in Topic:
Rownum
Andre Rothe <andre.rot  2008-01-04 12:11:11 
Re: Rownum
Lennart <Erik.Lennart.  2008-01-04 05:33:13 
Re: Rownum
Ed Prochak <edprochak@  2008-01-04 10:36:47 
Re: Rownum
Gene Wirchenko <genew@  2008-01-04 13:39:34 
Re: Rownum
Picard <picard@[EMAIL   2008-01-09 09:58:52 
Re: Rownum
Gene Wirchenko <genew@  2008-01-09 13:19:19 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Aug 21 21:54:17 CDT 2008.