Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Table Join with different values

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Thu Apr 18, 2013 12:19 pm    Post subject: Table Join with different values
Reply with quote

Hi,

I have 2 tables which needs to be joined based on Client and Product.

However one product is AA in Table A and BB in Table B. All other products are same on both tables. Is it possible to Join A and B for AA and BB. they are both same. Please let me know.

Code:


Table A
Client    Prod
----------------
123       AA
123       XX
345       TT
567       ZZ

Table B
Client  Prod  Data
---------------------
123     BB      Product Data1
123     XX     Product Data 2
345     TT     Product Data 3

Expected output 

Client   Prod         Data
-------------------------------
123      AA/BB       Product Data1
123     XX             Product Data 2
345     TT              Product Data 3

   


Please suggest if this is feasible through a left join or some way. I tried the REPLACE command in a left join but it was not working
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Apr 18, 2013 7:56 pm    Post subject:
Reply with quote

Hello,

How many other mis-matched pairs might eventually need to be supported? Why is there this mis-match?

How much would it take to make this value consistent in both files?

What you want to do would be trivial in a program and would be easier to expand if the requirement "grows".
Back to top
View user's profile Send private message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Mon Apr 22, 2013 12:49 pm    Post subject:
Reply with quote

HI Dick,

looks like there was a miscommunication among team located at different locations and evantually 2 various entries came into place. I guess this is the only entry that will remain so.
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Update table without cursor Ron Klop DB2 3 Wed Oct 11, 2017 1:06 pm
No new posts Table(Unicode(Graphic) table) loading... muralikrishnan_new DB2 0 Thu Oct 05, 2017 5:10 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm

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