Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
using column function while using join
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to Assign a Function key to Mainf... upendrasri TSO/ISPF 4 Sat May 30, 2020 9:03 pm
No new posts Need SQL for two latest records havin... Q5P418 DB2 10 Sun May 10, 2020 8:24 am
No new posts Issue while fetching a column(Nullabl... VINAY PALLELA DB2 18 Tue Mar 31, 2020 9:33 pm
No new posts Rexx STRIP Equivalent function in CLIST upendrasri CLIST & REXX 5 Mon Mar 16, 2020 9:57 pm
No new posts OUTTRAP Equivalent function in CLIST upendrasri CLIST & REXX 5 Thu Mar 12, 2020 12:12 pm

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