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

joining two tables using SUBSTR - response (4) by dnoeth

$
0
0

This will also return a row for 'CH' matching 'CHG', you have to change it slightly:

SEL * FROM tb1 a , tb2 b
WHERE ','||b.cntry_code||',' LIKE '%,'||TRIM(a.cntry_code)||',%' ;                 

And it will cause a product join (unless there's an additional join-condition using equality).
 
This string-splitting topic has been done multiple times, depending on the release it might be quite simple (STRTOK_SPLIT_TO_TABLE in TD14).


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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