mysql 模糊查询 concat()
2017年02月08日 10:27:43
阅读数:15861
concat() 函数,是用来链接字符串。mysql
精确查询: select * from user where name=”zhangsan”
模糊查询; select * from user where name like “%zhang%”sql
在实际的使用中,条件是做为参数传递进来的。 因此咱们使用 concat() 函数mybatis
mybatis:
select * from user where name like concat(“%”, #{name},”%”)函数
concat(str1,str2,str3,str4,……….); 链接字符串函数,会生成一个字符串字符串