当前位置:Gxlcms > 数据库问题 > mysql 模糊查询 concat()

mysql 模糊查询 concat()

时间:2021-07-01 10:21:17 帮助过:17人阅读

concat() 函数,是用来连接字符串。

精确查询: select * from user where name=”zhangsan” 
模糊查询; select * from user where name like “%zhang%”

在实际的使用中,条件是作为参数传递进来的。 所以我们使用 concat() 函数

mybatis: 
select * from user where name like concat(“%”, #{name},”%”) 

concat(str1,str2,str3,str4,……….); 连接字符串函数,会生成一个字符串 

mysql 模糊查询 concat()

标签:rom   div   连接字符串   使用   class   zhang   mysql   精确   字符串   

人气教程排行