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

Using column function while using JOIN


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

New User


Joined: 14 Mar 2011
Posts: 14
Location: India

PostPosted: Thu Jun 16, 2011 3:01 pm
Reply with quote

Thanks yaar,

I got the exact result as i expected...

I used full outer join and got the thing ...

SELECT * FROM
(SELECT STS AS R_STS,COUNT(*) AS R_CNT
FROM TAB_R
WHERE R_DATE = CURRENT DATE
GROUP BY STS)R
FULL OUTER JOIN
(SELECT STS AS I_STS,COUNT(*) AS I_CNT
FROM TAB_I
WHERE I_DATE = CURRENT DATE
GROUP BY STS)I
ON R.R_STS = I.I_STS
WITH UR;

OUTPUT:
-----------
R_STS R_CNT I_STS I_CNT
---- ----------- ---- -----------
AWST 1 - -
CANC 1 CANC 1
- - RECV 6
- - REJD 16
SETT 108739 SETT 108625

THANKS FOR TELLING THE KEYWORD FULL OUTER JOIN ..NOW I'M CLEAR ....
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
Search our Forums:

Back to Top