MySQL: How to search multiple tables for a string existing in any column

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 19:11:11

Add fulltext indexes to all of the string columns in all of those tables, then union the results

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')
...
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!