I have 2 tables, one with long string + int values, the other with short strings, i would like to match each row in table1 to NOT contain any value in table2
table1 values: 'i like my iphone now', 'iphone is great', 'this is also here'
table2 values: 'iphone' 'galaxy'
i need the output to be only row 3 in table1 but when i do this:
select * from table1 a, table2 b
where NOT (a.input RLIKE concat('(^|.* )', TRIM(b.exclude_word), '( .*|$)'));
it doesn't work because table1 a, table2 join
is full outer join and i will always be left with values duplicated that don't match.