select * from table1 A,(select * from table2 where aid = ~id~ limit 0,30) B WHERE A.title like CONCAT('%',B.F1,'%')其中单独查询:select * from table2 where aid = ~id~ limit 0,30 输出结果为:三,李
如果执行查询:select * from table1 where teble1.title like '%三%' or teble1.title like '%李%' limit 0,10 则可以正常获取数据为何将select * from table2 where aid = ~id~ limit 0,30查询结果放到select * from table1 where teble1.title like '%三%' or teble1.title like '%李%' limit 0,10来查询时什么都查询不到呢?错在哪?请各位大大不吝赐教!!!!
如果执行查询:select * from table1 where teble1.title like '%三%' or teble1.title like '%李%' limit 0,10 则可以正常获取数据为何将select * from table2 where aid = ~id~ limit 0,30查询结果放到select * from table1 where teble1.title like '%三%' or teble1.title like '%李%' limit 0,10来查询时什么都查询不到呢?错在哪?请各位大大不吝赐教!!!!
其实不用limist也能查询到,单条查询可以,组合就不行,例如:select * from table1 where teble1.title like '%三%' or teble1.title like '%李%' 是可以查询到的就是查询将select * from table2 where aid = ~id~ limit 0,30查询结果放进去查询就不行了,不知为何
MYSQL根本不支持这种语法。select * from tableB b
where exists (select 1 from (select * from table where aid = ~id~ limit 1,30) a where instr(b.title,a.name))