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
相关推荐
百***99242 小时前
MySql的慢查询(慢日志)q***13342 小时前
在linux(Centos)中Mysql的端口修改保姆级教程理想三旬3 小时前
关系数据库千寻技术帮4 小时前
50022_基于微信小程序同城维修系统无心水4 小时前
【分布式利器:RocketMQ】2、RocketMQ消息重复?3种幂等方案,彻底解决重复消费(附代码实操)q***98525 小时前
基于人脸识别和 MySQL 的考勤管理系统实现l1t5 小时前
用SQL求解advent of code 2024年23题办公解码器6 小时前
Excel工作表打开一次后自动销毁文件,回收站中都找不到爬山算法7 小时前
Redis(127)Redis的内部数据结构是什么?百***25617 小时前
MySQL 实验1:Windows 环境下 MySQL5.5 安装与配置