我有 2 个表,一个带有长字符串 + int 值,另一个带有短字符串,我想匹配 table1 中的每一行以不包含 table2 中的任何值
表 1 值:“我现在喜欢我的 iphone ”、“ iphone 很棒”、“这也在这里”
表 2 值:' iphone ''银河'
我需要输出只是 table1 中的第 3 行,但是当我这样做时:
select * from table1 a, table2 b
where NOT (a.input RLIKE concat('(^|.* )', TRIM(b.exclude_word), '( .*|$)'));
它不起作用,因为它table1 a, table2 join
是完全外连接,我总是会留下不匹配的重复值。