当前位置: 代码迷 >> 综合 >> sql like 拼接 %% mapper CONCAT sql字符串连接
  详细解决方案

sql like 拼接 %% mapper CONCAT sql字符串连接

热度:13   发布时间:2024-01-31 14:44:12.0

例如需求是获取用户表中的所有名字中带“2”的数据:

Mapper  sql: 

@Select("select * from user where name like CONCAT('%',#{goods_name},'%');")

CONCAT(),在数据库sql中用于字符串连接。

  相关解决方案