Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
quersies for selecting the record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
Author Message
tomrsan

New User


Joined: 15 Oct 2005
Posts: 14
Location: chennai

PostPosted: Wed Dec 14, 2005 10:03 am    Post subject: quersies for selecting the record
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
References
khamarutheen

Senior Member


Joined: 23 Aug 2005
Posts: 678
Location: chennai

PostPosted: Wed Dec 14, 2005 11:50 am    Post subject: emp table
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: 14
Location: chennai

PostPosted: Thu Dec 15, 2005 10:30 am    Post subject: Re: quersies for selecting the record
Reply with quote

hi
thanx 4 aswering now iam cleared
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1