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;

相关推荐
Trouvaille ~12 小时前
【Redis篇】Redis 哨兵(Sentinel):高可用自动故障转移
数据库·redis·缓存·中间件·sentinel·高可用·哨兵
qfljg12 小时前
oracle 迁移到postgres
数据库·oracle
giaz14n9X13 小时前
Redis 分布式锁进阶第五十七篇
数据库·redis·分布式
剑神一笑13 小时前
Linux ls 命令深度解析:从目录遍历到颜色输出的实现原理
linux·服务器·数据库
Maynor99614 小时前
Codex API 网关迁移与流量优化实战
数据库·oracle
WyCAGy8ij14 小时前
Redis 分布式锁进阶第二篇讲解
数据库·redis·分布式
南极企鹅14 小时前
MySQL的两大支柱:undo Log&redo log
数据库·mysql·oracle
智航GIS14 小时前
ArcGIS大师之路500技---078文件数据库的加密与解密
数据库·arcgis
音乐宝贝家15 小时前
吉他面板材质怎么选?云杉单板面单吉他配置深度解析
数据库·新媒体运营·产品运营·媒体·材质·内容运营
2401_8734794015 小时前
企业安全运营中,如何用IP离线库提前发现失陷主机?三步实现风险画像
网络·数据库·python·tcp/ip·ip