1.mysql数据库
SELECT
*
FROM
user
WHERE
name like CONCAT('%',#{name},'%')
2.oracle数据库
SELECT
*
FROM
user
WHERE
name like CONCAT('%',#{name},'%')
或
SELECT
*
FROM
user
WHERE
name like '%'||#{name}||'%'
3.SqlServer数据库
SELECT
*
FROM
user
WHERE
name like '%'+#{name}+'%'
4.DB2数据库
SELECT
*
FROM
user
WHERE
name like CONCAT('%',#{name},'%')
或
SELECT
*
FROM
user
WHERE
name like '%'||#{name}||'%'