摘要: 问:sql 中 select * from A left join B on A.id=B.id where A.id=? 如果在Hibernate 中 用HQL 怎么表达呢 ?答:from A left join A.b b where A.id=?其中b是在实体类A的hibernate配置文件中 阅读全文
posted @ 2017-03-09 15:05 一万年以前 阅读(5741) 评论(0) 推荐(0) 编辑
摘要: 使用内部函数instr,可代替传统的like方式查询,并且速度更快。 instr函数,第一个参数是字段,第二个参数是要查询的串,返回串的位置,第一个是1,如果没找到就是0. 例如, select name from tpl_user where 1 and instr(`name`,’jack’); 阅读全文
posted @ 2017-03-09 14:57 一万年以前 阅读(5298) 评论(0) 推荐(0) 编辑