Mysql-模糊查询
-- 模糊查询(where name like 要查询的数据)
-- like
-- % 替换任意个
-- _ 替换1个
-- 查询名字中 以“凌”开始的名字
select * from student where name like "凌%";
-- 查询姓名中 有“万”所有的名字
select * from student where name like "%万%";
-- 查询有2个字的名字
select * from student where name like "__";
-- 查询有3个字的名字
select * from student where name like "___";
-- 查询至少有2个字的名字
select * from student where name like "__%";
表取自:
浙公网安备 33010602011771号