IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

quersies for selecting the record


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
tomrsan

New User


Joined: 15 Oct 2005
Posts: 13
Location: chennai

PostPosted: Wed Dec 14, 2005 10:03 am
Reply with quote

hi pls help me to



1.QUERY for retrieving first 15th record to 25th record?


2.QUERY for retrieving last record to 15th record? order of retrieval should be
last record
last but one record
......
........
.........
15th record
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Wed Dec 14, 2005 11:50 am
Reply with quote

hi frnd,

Quote:
2.QUERY for retrieving last record to 15th record?


Code:
 SELECT * FROM EMP
 ORDER BY ENO DESC
 FETCH FIRST 15 ROWS ONLY


i have not tried the above query but plz check it...

else u can go for between with any primary key

ie.,
Code:
SELECT * FROM EMP WHERE EMPNO BETWEEN 15 AND 30
       ORDER BY EMPNO DESC



Quote:
1.QUERY for retrieving first 15th record to 25th record?


Code:
 SELECT * FROM EMP WHERE EMPNO BETWEEN 15 AND 25


hope got it
Back to top
View user's profile Send private message
tomrsan

New User


Joined: 15 Oct 2005
Posts: 13
Location: chennai

PostPosted: Thu Dec 15, 2005 10:30 am
Reply with quote

hi
thanx 4 aswering now iam cleared
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top