模糊查询
Posted han-java
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了模糊查询相关的知识,希望对你有一定的参考价值。
String hql = " from JX_ExerciseDb where jdd like ‘%"+jdd+"%‘ and moduleid = ‘"+trainid+"‘ and type = 01";
Query qu = session.createQuery(hql);
List singlechoose = qu.list();
String hql = "select max(serial) from JX_ExerciseDb where type = " + type + " " +
"and jdd like ‘" + jdd + "%"+isimport+"‘ and moduleid = " + moduleid + " and usestate = 01 ";
"and jdd like ‘" + jdd + "%"+isimport+"‘ and moduleid = " + moduleid + " and usestate = 01 ";
在进行模糊查询时,QBC里用了"%"+jdd+"%",在最外面用了双引号;HQL里用了‘%"+jdd+"%‘ ,在这里是使用的单引号。
在mysql中 使用like "%bin%"
在ORACLE中 使用like ‘%bin%‘
以上是关于模糊查询的主要内容,如果未能解决你的问题,请参考以下文章