MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

fetching row

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
guptaji
Beginner


Joined: 20 Jan 2007
Posts: 5
Topics: 4
Location: DELHI

PostPosted: Tue Jan 23, 2007 10:44 pm    Post subject: fetching row Reply with quote

Hi,
suppose there are 100 records in a table, I want to select 10records starting from 11th to 20th. What query should I use?

Thanks
Back to top
View user's profile Send private message
hareshh
Beginner


Joined: 13 Dec 2006
Posts: 16
Topics: 0

PostPosted: Wed Jan 24, 2007 7:01 am    Post subject: Reply with quote

Query:
SELECT rowid_column, column_name FROM table_name
GROUP BY rowid_column, column_name HAVING rowid_column BETWEEN 11 AND 20

If you want to know about rowid column refer link:
http://www.mvsforums.com/helpboards/viewtopic.php?t=627&highlight=rowid

Regards,
Haresh.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jan 24, 2007 7:03 am    Post subject: Reply with quote

guptaji,

If you have DB2 Version 8 then check this link. The link shows how to sequence your result set. Using the seqnuence # you can pick the desired rows.


http://www-1.ibm.com/support/docview.wss?fdoc=imdb2z&rs=64&uid=swg27005359

http://www-1.ibm.com/support/docview.wss?rs=64&uid=swg27006576

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group