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

Data between two tables. - response (3) by Mathuram

$
0
0

For the required result, using SUBSTRING is enough but if the Col1 column having more number of commas i.e unpredicatable means that time you can go for Recursive query. using Resursive is best for alltime.
 
sel key, substr(col1,1,position(',' in col1)-1) A, substr(col1,position(',' in col1)+1) B, substr(B,1,position(',' in B)-1) C,
substr(B,position(',' in B)+1) D from Tab1
 
use col A,C and D in join condition to get the required result.


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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