首页 > 数据库技术 > 详细

MySql模糊查询 concat()函数

时间:2020-03-19 15:06:35      阅读:213      评论:0      收藏:0      [点我收藏+]

在sql语句之中,查询根据场景要求不同有两种方式,精准查询与模糊查询:

 

精确查询语法:select * from student where name="zhangsan";

模糊查询语法:select * from student where name like "%*san%";

 

而在java开发时,往往查询条件是作为参数传递过来的所有,所有在有了concat()函数:

 

select * from student where name like concat("%",#{name},"%");

可以看出concat()函数的作用为连接字符串。

 

MySql模糊查询 concat()函数

原文:https://www.cnblogs.com/huqingfeng/p/12524125.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!