I'm using postgresql 9.3 and I'm trying to inner join two tables on common string patterns of a minimum length.
Also I'm a noob to SQL try to be patient if possible.
For example:
TABLE 1
ID        DATA
1         '1234,5678,1234,1111'
2         '1111,2222'
3         '4321'
TABLE 2
IDa        DATA
1a         '1111,2222,1234,5678,4321'
2a         '1111,3837,2222'
3a         '4321'
joining DATA column on strings matching more than 9 chars would yield:
IDa    ID     DATA
1a     2     '1111,2222'
1a     1     '1234,5678'
I had some success using LIKE but I can't force a minimum match length condition(or at least I don't know how). I'm assuming a regex is the solution here but I haven't been able to write one that accomplished what I'm looking for.
 
     
     
    