针对不同的数据库,like的用法是不一样的,现在具体来说一下
1,SQL SERVER
SELECT * FROM user WHERE name like '%'+#{name}+'%'
2,Oracle
SELECT * FROM user WHERE name like '%'||#{name}||'%'
3,Mysql
SELECT * FROM user WHERE name like CONCAT('%',#{name},'%')
针对不同的数据库,like的用法是不一样的,现在具体来说一下
1,SQL SERVER
SELECT * FROM user WHERE name like '%'+#{name}+'%'
2,Oracle
SELECT * FROM user WHERE name like '%'||#{name}||'%'
3,Mysql
SELECT * FROM user WHERE name like CONCAT('%',#{name},'%')