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 Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts unload data from table with lob columns farhad_evan DB2 1 Sat Apr 22, 2017 1:32 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm


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