码迷,mamicode.com
首页 > 其他好文 > 详细

模糊查询

时间:2018-08-15 15:31:54      阅读:157      评论:0      收藏:0      [点我收藏+]

标签:ESS   echo   like   rom   string   ora   creat   mysql   where   

  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  "; 
 
在进行模糊查询时,QBC里用了"%"+jdd+"%",在最外面用了双引号;HQL里用了‘%"+jdd+"%‘ ,在这里是使用的单引号。
 
在MYSQL中 使用like "%bin%"
在ORACLE中 使用like ‘%bin%‘

模糊查询

标签:ESS   echo   like   rom   string   ora   creat   mysql   where   

原文地址:https://www.cnblogs.com/han-java/p/9481585.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!