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.
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.