IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to retrieve the 7th row from the table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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
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 All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To join 2 tables and to join 3rd tabl... DB2 8
No new posts Create a specific record/file based o... SYNCSORT 8
No new posts Extract ISPF table column headings CLIST & REXX 2
No new posts Unload and Load ISPF Table TSO/ISPF 4
No new posts ISPF Table to add a new column TSO/ISPF 1
Search our Forums:


Back to Top