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
相关推荐
liuyouzhang37 分钟前
将基于Archery的web数据库审计查询平台封装为jdbc接口的可行性研究(基于AI)Meepo_haha4 小时前
配置 Redisu0109147606 小时前
CSS组件库如何快速扩展_通过Sass @extend继承基础布局baidu_340998826 小时前
Golang怎么用go-noescape优化性能_Golang如何使用编译器指令控制逃逸分析行为【进阶】m0_678485456 小时前
如何利用虚拟 DOM 实现无痕刷新?基于 VNode 对比的状态保持技巧qq_342295826 小时前
CSS如何实现透明背景效果_通过RGBA色彩模式控制透明度panzer_maus6 小时前
MySQL 索引介绍与索引优化的简单介绍Greyson16 小时前
CSS如何处理超长文本换行问题_结合word-wrap属性captain3766 小时前
事务___justjinji6 小时前
如何批量更新SQL数据表_使用UPDATE JOIN语法提升效率