如何搜索in table_a table_b table_c,其中的字符串具有随机的列数?
table_a table_b table_c
我知道这是不正确的sql,但是会是这样的:
SELECT * FROM users, accounts, something_else WHERE ->ANY COLUMN CONTAINS 'this_string'<-
提前为SO社区
将全文索引添加到所有这些表中的所有字符串列,然后合并结果
select * from table1 where match(col1, col2, col3) against ('some string') union all select * from table2 where match(col1, col2) against ('some string') union all select * from table3 where match(col1, col2, col3, col4) against ('some string') ...