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
相关推荐
rising start5 小时前
二、全面理解MySQL架构星星也在雾里5 小时前
PgBouncer 解决 PostgreSQL 连接数超限 + 可视化监控bqq198610266 小时前
MySQL性能优化雨辰AI7 小时前
SpringBoot3 + 人大金仓读写分离 + 分库分表 + 集群高可用 全栈实战长城20247 小时前
关于MySql的ONLY_FULL_GROUP_BY问题常常有7 小时前
MySQL 底层执行原理:输入SQL语句到两阶段提交Mr. zhihao8 小时前
深入解析redis基本数据结构m0_748839498 小时前
利用天正暖通CAD快速掌握风管数量统计的方法随身数智备忘录8 小时前
什么是设备管理体系?设备管理体系包含哪些核心模块?海市公约9 小时前
MySQL更新语句执行全流程:从Buffer Pool修改到二阶段提交