56,679
社区成员
发帖
与我相关
我的任务
分享
#1. 创建临时表
CREATE TEMPORARY TABLE tmp (id bigint primary key);
#2. 将相关数据的主键插入到临时表中,
insert into tmp(id)
select id from tb where theName like '%企业名称%';
#3. 查询得到实际的结果
select * from tb as a inner join tmp as b on a.id=b.id;
#4. 删除临时表
drop TEMPORARY table tmp;
当然, 最好的做法还是 ES.