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

how to select nth row from table


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
veera
Warnings : 1

New User


Joined: 24 Nov 2004
Posts: 20
Location: chennai

PostPosted: Fri Nov 26, 2004 9:55 pm
Reply with quote

hello,
any one plse tell me,how to select nth row from table.
Back to top
View user's profile Send private message
jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 160
Location: Toronto, Canada

PostPosted: Sat Nov 27, 2004 3:52 am
Reply with quote

Veera,
Once a query posted please do not post it again.


SELECT *
FROM TEST.TABLE1 T1
WHERE 5 = ( SELECT COUNT(DISTINCT T2.NUM)
FROM TEST.TABLE2 T2
WHERE T2.NUM >= T1.NUM)
ORDER BY NUM DESC ;;

This should solve your problem.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 677
Location: NJ

PostPosted: Tue Nov 15, 2005 2:36 pm
Reply with quote

hi frnd,
u can enter the row condition which u are going to retrive na. then use that..
Eg:
Select * from emp
where emptno=:empno;


hope enough.. let me know if wrong
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Check data with Exception Table DB2 0
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top