请教一个嵌套查询的问题
条件:
表table1
查询结果:
在根据table1查出来的结果中再根据某些列模糊查询相关记录
例如:
id name type name_type details info
table2=SELECT * FROM table1 WHERE type <> '2' && (name_type between 1 and 2)
那么我怎样根据sql1查询出来的记录进行下一步的模糊列查询(两条语句要合并成一条)
select * from table2 where name,details,info like "%$keyword%"
麻烦各位高手指点一下,屡试多次都提示语法不对
select *
from (SELECT * FROM table1 WHERE type <> '2' && (name_type between 1 and 2))
where name,details,info like "%$keyword%"