I have a column that is a comma separated string of values. I want to join another table that only has one of the values. On redshift, how can I do a LIKE operator with '%' injected into the comparison?
Ex:
TableA: values_col = 'abc, def'
TableB: value_col = 'def'
SELECT *
FROM TableA a
JOIN TableB b ON b.value_col LIKE '%' || a.values_col || '%'
The above concat doesn't seem to work. Any suggestions would be appreciated. Thanks.