MySQL where条件

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;

相关推荐
可涵不会debug1 小时前
【IoTDB】时序数据库选型指南:工业大数据场景下的技术突围
数据库·时序数据库
ByteBlossom1 小时前
MySQL 面试场景题之如何处理 BLOB 和CLOB 数据类型?
数据库·mysql·面试
玉衡子1 小时前
九、MySQL配置参数优化总结
java·mysql
麦兜*1 小时前
MongoDB Atlas 云数据库实战:从零搭建全球多节点集群
java·数据库·spring boot·mongodb·spring·spring cloud
Slaughter信仰1 小时前
深入理解Java虚拟机:JVM高级特性与最佳实践(第3版)第十章知识点问答(10题)
java·jvm·数据库
麦兜*1 小时前
MongoDB 在物联网(IoT)中的应用:海量时序数据处理方案
java·数据库·spring boot·物联网·mongodb·spring
-Xie-2 小时前
Mysql杂志(十六)——缓存池
数据库·mysql·缓存
玉衡子2 小时前
八、MySQL全局优化总结&MySQL8新特性
java·mysql
七夜zippoe2 小时前
缓存与数据库一致性实战手册:从故障修复到架构演进
数据库·缓存·架构