mybatis中Like语句使用方式
-- mysql数据库:
SELECT
*
FROM
user
WHERE
name like CONCAT('%',#{name},'%')
-- oracle数据库:
SELECT
*
FROM
user
WHERE
name like '%'||#{name}||'%'
-- SQLServer数据库:
SELECT
*
FROM
user
WHERE
name like '%'+#{name}+'%'
-- DB2数据库:
SELECT
*
FROM
user
WHERE
name like CONCAT('%',#{name},'%')
-- 或
SELECT
*
FROM
user
WHERE
name like '%'||#{name}||'%'