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
相关推荐
jyOverQ1 分钟前
Redis 持久化怎么做?RDB、AOF 与混合持久化j7~2 分钟前
【C++ 标准项目】发布订阅消息队列(篇四):sqlite 与 gtest 断言框架介绍及实战应用于指尖飞舞7 分钟前
mysql和redis面试题总结维克兜率天10 分钟前
【维克】通道突破:画出趋势的“轨道线“ao-weilai13 分钟前
MySQL数据库:复合查询Omics Pro15 分钟前
北理工李荣华:AI虚拟细胞证据多模态推理基准一个天蝎座 白勺 程序猿19 分钟前
IoTDB集群扩容:从慌乱到从容的经验分享FYKJ_201021 分钟前
SpringSecurity教室智能预约系统73972-计算机课程设计、毕业设计写后端的胖头鱼26 分钟前
详解索引下推