Mysql模糊查询之LIKE CONCAT('%',#{name},'%')
众所周知,SQL语句中的like模糊查询 select * from table where name like‘%张蛋%’,但实际开发中经常用到 select * from table where name like concat(#{name},'%')比如根据用户名或手机号模糊查找用户(us.nick_name LIKE CONCAT('%',#{keyWord},'%'...
·
众所周知,SQL语句中的like模糊查询 select * from table where name like‘%张蛋%’,
但实际开发中经常用到 select * from table where name like concat(#{name},'%')
比如根据用户名或手机号模糊查找用户
(us.nick_name LIKE CONCAT('%',#{keyWord},'%') OR us.phone LIKE CONCAT('%',#{keyWord},'%'))
更多推荐
已为社区贡献1条内容
所有评论(0)