Quantcast
Viewing all articles
Browse latest Browse all 1291

Joining 2 columns with different data types

Hi All,

 

I have a doubt regarding a join condition, hope anyone of you can help in resolving it

 

1st column (ACCNO) in the join is always 8 digit numeric value and

2nd column (UNIT) has mostly numeric values (but with different lengths) and some string values(Alphabhets)

 

We want to implement a case statement to do this where if the column has numeric value then the join should convert the UNIT column to 8 length and connect to ACCNO else it should be null

 

How to find if the implement this as a join condition (does Digits function in IDT work for this?)

 

 

To change the length of 2nd column, I'm planning on using RIGHT('00000000' || B_LEDGER.UNIT,8)

Client Data base: DB2

Universe is built on IDT 4.0 SP04 version

 

Thanks in advance,

Mitch


Viewing all articles
Browse latest Browse all 1291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>