We are migrating an Oracle application and hence changing it to cursors is
only the last resort. Wanted to check if there is any staright equivalent of
rownum of Oracle in DB2. 

Thanks 
Ranjana

-----Original Message-----
From: Seibert, Dave [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 15, 2001 7:18 PM
To: [EMAIL PROTECTED]
Subject: RE: DB2EUG: Fetch First n rows only ???


I believe you're looking for the row_number function.
(Thanks to Terry Purcell for making me aware of this)

Here's an example:

select id,name , row_number( ) over () from staff

David Seibert
Compuware Corporation File-AID Product Architect
[EMAIL PROTECTED]



=====
To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
For other info (and scripts), see http://people.mn.mediaone.net/scottrmcleod

=====
To unsubscribe, send 'unsubscribe' to [EMAIL PROTECTED]
For other info (and scripts), see http://people.mn.mediaone.net/scottrmcleod

Reply via email to