庞玉栋个人博客、人生苦短-我用Python

MySQL多关键字多字段模糊查询

发布时间:8年前热度: 1085 ℃评论数:
sql="select *,teacher.teacherID as teacherName, "
					+ "department.depID as depName "
					+ "from teacher,article,department "
					+ "where teacher.teacherID=article.teacherID and department.depID=article.depID and articleName like '%"+f2+"%' "//查询关键字
					+ "and teacherName like '%"+f3+"%' "
					+ "and year like '%"+f6+"%' "
					+ "and depName like '%"+f9+"%' "
					+ "order by articleID";

my sql,Java

手机扫码访问