MyBatis中Like语句使用

MyBatis中Like语句使用方式

oracle数据库:


SELECT
*
FROM
user
WHERE
name like CONCAT('%',#{name},'%')SELECT
*
FROM
user
WHERE
name like '%'||#{name}||'%'

SQLServer数据库

SELECT
*
FROM
user
WHERE
name like '%'+#{name}+'%'

mysql数据库:

SELECT
*
FROM
user
WHERE
name like CONCAT('%',#{name},'%')

DB2数据库:

SELECT
*
FROM
user
WHERE
name like CONCAT('%',#{name},'%')SELECT
*
FROM
user
WHERE
name like '%'||#{name}||'%'

你可能感兴趣的:(数据库)