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
相关推荐
小猿姐7 小时前
Clickhouse Kubernetes Operator 实测:哪种方案更适合生产?2501_921939267 小时前
MHA高可用_Evan_Yao8 小时前
MySQL 基础:SELECT、WHERE、JOIN 的第一次使用weixin_444012938 小时前
c++如何将std--vector直接DUMP到二进制文件_指针地址直写【附代码】woxihuan1234569 小时前
Go语言中--=运算符详解:位右移赋值操作的原理与应用java1234_小锋9 小时前
SpringBoot为什么要禁止循环依赖?神仙别闹9 小时前
基于QT(C++)实现学生成绩管理系统m0_690825829 小时前
如何备份被破坏的数据表_强制跳过错误的导出尝试tongyiixiaohuang10 小时前
轻易云平台助力快麦数据入库MySQL残 风10 小时前
快速理解什么是MVCC?