Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts PC (UTF-8) -> z/OS (EBCDIC) -> ... prino All Other Mainframe Topics 4 Fri Sep 01, 2017 1:47 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us