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
相关推荐
凌虚2 小时前
面向 MySQL 用户的 PostgreSQL 快速上手指南五阿哥永琪2 小时前
MySQL中操作json的函数!来者皆善2 小时前
了解Mysql优化吗?如何优化索引?赤壁小虾4 小时前
【渲染流水线】[逐片元阶段]-[透明度测试]以UnityURP为例MC皮蛋侠客4 小时前
SQLAlchemy 系列(七):高级建模与高效写入——批量 DML、方言与扩展奈斯先生Vector5 小时前
把 Midjourney 二次编辑做成生产系统:customId 能力令牌、Action Graph 与 WebUI 精修工作台Lethehong6 小时前
双擎并驱·全链路并行:KFS让TB级异构增量同步秒级到达MC皮蛋侠客6 小时前
SQLAlchemy 系列(八):AsyncIO、并发与 Web 生命周期——让每个并发任务持有自己的 Session一水6 小时前
Redis实战:一个AI工作流系统里的五个应用场景,从传参到限流的完整链路Ai拆代码的曹操6 小时前
MySQL GROUP BY 性能优化:执行计划分析 + 索引重构实战