Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

joining two tables using SUBSTR - forum topic by Lalithachintha

$
0
0

Hi All,
I have a requirement where there are two tables Tbl1 and Tbl2 .i want to join these two tables based on the columns Cntry_code.
The Data is like :
Tbl1                                                          Tbl2 
Column Name : Cntry_code                      Column Name : Cntry_code
Values :  'FL'                                             Values :  'FL,CHG,MN'
               'CHG'                                                         'MN,MN'
               'DET'                                                          'DET'
               'MN'
My requirement,  is I need to join Tbl1.'FL' to Tbl2.'FL' , Tbl1.'CHG' to Tbl2.'CHG' ,but that is present in the 1st row as a substring.
Also if the same code 'MN,MN' occures twice , it should take only one 'MN' and join.
Can anyone please help me in this? 
Thank you in advance!!
 

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



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