Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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
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    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

khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

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: 13
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us