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

Need to fetch the max(seq-no) from the 2 tables


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

New User


Joined: 01 Jun 2006
Posts: 23
Location: Sinagpore

PostPosted: Fri Nov 02, 2007 12:32 pm
Reply with quote

Hi

AA721T - bcm,seq-no
AA723T - bcm,seq-no

I need to fetch the max(seq-no) from the 2 tables.

pl help

cheers
venkat
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Fri Nov 02, 2007 6:13 pm
Reply with quote

Hi,
This should work, If I understand your requirement correctly..:-)

SELECT MAX(SEQ-NO) FROM TABLE
(SELECT SEQ-NO FROM AA721T
UNION
SELECT SEQ-NO FROM AA721T) AS T1;
Back to top
View user's profile Send private message
venkatm99

New User


Joined: 01 Jun 2006
Posts: 23
Location: Sinagpore

PostPosted: Mon Nov 05, 2007 8:30 am
Reply with quote

Thanks Sri

cheers

venkat[/code]
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 Fetch data from programs execute (dat... DB2 3
No new posts Code Multi Row fetch in PL1 program PL/I & Assembler 1
No new posts Need to fetch data from so many DB2 t... DB2 9
No new posts How to: PK does not exist in several ... DB2 6
No new posts Discrepancy b/w SYSIBM tables and BMC... DB2 0
Search our Forums:

Back to Top