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
 

 

How to retrieve the 7th row from the table

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
sridharvedula

New User


Joined: 24 Mar 2005
Posts: 3

PostPosted: Fri Apr 22, 2005 12:09 pm    Post subject: How to retrieve the 7th row from the table
Reply with quote

hi,

How to retrieve the 2nd min sal from the table?

How to retrieve the 7th row from the table?

plzz post the queries solution as early as possible
Back to top
View user's profile Send private message

gaurchetan
Warnings : 1

New User


Joined: 20 Mar 2005
Posts: 6

PostPosted: Sat Apr 23, 2005 11:20 am    Post subject: Re: How to retrieve the 7th row from the table
Reply with quote

hi there,
i don't know about how to retrieve 7th row but for 2nd min sal the query is

select min(sal) from saltab
where sal not in (select min(sal) from saltab);
please let me know about how to retreive 7th row.
Back to top
View user's profile Send private message
SINDHU

New User


Joined: 22 Apr 2005
Posts: 2
Location: CHENNAI

PostPosted: Sat Apr 23, 2005 12:16 pm    Post subject:
Reply with quote

Hi
Hope this query would help you.
select min(sal) from emp where sal>(select min(sal) from emp).
Back to top
View user's profile Send private message
gvt460

New User


Joined: 04 Mar 2005
Posts: 23

PostPosted: Tue Apr 26, 2005 5:42 pm    Post subject: hai this is venkatesh
Reply with quote

i know how to fetch directly 7th row from table in application program only.
exec sql
declare cur sensitive static scroll cursor for select * from table
end-exec
exec sql
open cur
end-exec.
exec sql
fetch absolute 7 into :dcltab
end-exec.
exec sql
close cur
end-exec.

check this one.....
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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm
No new posts Command UNIQUE CONSTRAINT on any tabl... rohanthengal DB2 2 Thu Aug 18, 2016 3:48 pm
No new posts Need to retrieve Julian_date Suganya87 DB2 4 Wed Aug 17, 2016 7:27 pm
No new posts Updating online Db2 table kishpra DB2 3 Fri Aug 12, 2016 2:44 pm


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