where条件查询的语法格式:
select * from 表名 where 条件
比较运算符查询:
查询编号大于8的学生: select * from students where id > 8;
查询编号小于等于4的学生: select * from students where id <= 4;
查询没被删除的学生: select * from students where delete=0逻辑运算符查询 :
查询年龄不在20岁到35岁之间的学生: select * from students where not (age >= 20 and age <= 35);
模糊查询 :
like是模糊查询关键字
%表示任意多个任意字符查询姓杨或张的学生: select * from students where name like '杨%' or name like '%靖张';
空判断查询:
判断为空使用: is null
判断非空使用: is not null
查询没有填写体重的学生: select * from students where weight is null;
MySQL where条件
代码真的养发2023-11-05 9:47
相关推荐
舒一笑1 小时前
MySQL中模糊匹配like的一个坑m0_748254092 小时前
2025最新华为云国际版注册图文流程-不用绑定海外信用卡注册大新屋2 小时前
MongoDB 分片集群修改管理员密码ejinxian2 小时前
MySQL/Kafka数据集成同步,增量同步及全量同步未来之窗软件服务2 小时前
数据库优化提速(一)之进销存库存管理—仙盟创梦IDEMapmost3 小时前
信创浪潮下的GIS技术变革:从自主可控到生态繁荣foundbug9993 小时前
Node.js导入MongoDB具体操作天天进步20153 小时前
Node.js中的Prisma应用:现代数据库开发的最佳实践@_码农4 小时前
【MySQL的卸载】hui函数4 小时前
Flask高效数据库操作指南