在mybatis中模糊查询有三种写法
生活随笔
收集整理的這篇文章主要介紹了
在mybatis中模糊查询有三种写法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<select id="selectStudentsByName" resultType="Student">
<!--第一種-->
? ?<!-- select id,name,age,score from student where name like '%' #{0} '%' -->
<!--第二種-->
<!-- select id,name,age,score from student where name like concat('%', #{0}, '%') -->
? ? ? ?<!--第三種-->
<!--'%${value}%' :為字符串拼接 -->
select id,name,age,score from student where name like '%${value}%'
</select>
轉載于:https://www.cnblogs.com/hwgok/p/7674380.html
總結
以上是生活随笔為你收集整理的在mybatis中模糊查询有三种写法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 当一辆车消失在天际是什么歌呢?
- 下一篇: 雕刻机多少钱啊?