数据库基本操作(5)

模糊查询
一、占位符
1。(_:单个任意字符)
2。(%:多个任意字符)
例:查询student表中姓马的人
select * from student where name like ’ 马%';
例:查询姓名中第二个字是华的人
select * from student where name like ’ _华%';
例:查询姓名是三个名字的人
select * from student where name like ’ ___';(引号内是三个下划线)
例:查询姓名中包含马的人
select * from student where name like ’ %马%';

猜你喜欢

转载自blog.csdn.net/m0_46217913/article/details/104084595