sql查询符合手机号后四位数的手机号,符合mybatis语法,要求在搜索框中打入四个数字,搜索出符合要求的手机号
SELECT * FROM tableName WHERE telphone LIKE CONCAT(CONCAT('%', #{text}));
SELECT * FROM tableName WHERE name LIKE CONCAT(CONCAT('%', #{text}), '%');
或
SELECT * FROM tableName WHERE name LIKE '%${text}%';
<select id="selectByName" parameterType="String" resultType="Student">
select * from Student s where s.name like "%"#{name}"%";
</select>
一年了,楼主找到答案了吧,怎么不把答案贴出来呢
SELECT * FROM Student
where tel LIKE '%4440'
SELECT * FROM Student
where tel LIKE '%%4440'