MySQL where条件

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;

相关推荐
数据知道7 分钟前
一文掌握 MongoDB 详细安装与配置(Windows / Linux / macOS 全平台)
linux·数据库·windows·mongodb·macos
Knight_AL8 分钟前
Flink 状态管理详细总结:State 分类、Keyed State 实战、Operator State、TTL、状态后端选型
前端·数据库·flink
ADRU9 分钟前
Dify API 数据库连接与 Session 管理架构调研
数据库·架构
zhglhy10 分钟前
Redis Cluster 的数据分片机制
数据库·redis·缓存
奥特曼_ it14 分钟前
【NLP舆情分析】基于python微博舆情分析可视化系统(完整系统源码+数据库+详细部署教程)✅
数据库·python·自然语言处理
Mr__Miss18 分钟前
Mysql的redo log和undo log
数据库
luoluoal28 分钟前
基于python的web渗透测试工具(源码+文档)
python·mysql·django·毕业设计·源码
码界奇点1 小时前
深入解析MySQL9主从复制架构详解从原理到实战优化
数据库·sql·架构·可用性测试
Miha_Singh1 小时前
查询优化综述:《A Survey of Query Optimization in Large Language Models》
数据库·人工智能·语言模型·查询优化·查询改写
打工的小王2 小时前
Redis(一)redis的下载安装与使用
数据库·redis·缓存