sql="select * from 用户表 where 用户编号 not in( select 用户编号 from 回收站 ) and '"+type+"' like '%"+key+"%'";的到的结果
select * from 用户表 where 用户编号 not in( select 用户编号 from 回收站 ) and '姓名' like '%天才说话%'因为 and '姓名' 的关系, 我什么也查不出来。
但是去'' 又语法错误。。
不知道该怎么解决。
select * from 用户表 where 用户编号 not in( select 用户编号 from 回收站 ) and '姓名' like '%天才说话%'因为 and '姓名' 的关系, 我什么也查不出来。
但是去'' 又语法错误。。
不知道该怎么解决。
但是我是通过页面参数得到的
"******** and "+姓名+" ";
这样没语法错误吗?
"******** and "+姓名+" ";
表明姓名是变量了
sql = "select * from 用户表 where 用户编号 not in(select 用户编号 from 回收站) and ";
sql = sql + type + "like '%"+key+"%'";