模糊查询

-1、查询所有王姓同学
select * from xs where 姓名 like '王%'
--2、查询三个字姓王的同学
select * from xs where 姓名 like '王__'
--3、姓王和姓张的同学
select * from xs where 姓名 like '[王,张]%'
--4、查询不是姓王和姓张的同学
select * from xs where 姓名 like '[^王,张]%'

原文地址:https://www.cnblogs.com/huanhuan55/p/9766342.html