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;

相关推荐
牛奶咖啡1316 小时前
MySQL InnoDB Cluster 高可用集群部署与应用实践(下)
数据库·mysql·innodb cluster·mysql router·mysql路由的安装部署·mysql路由的测试·mgr组复制
姚远Oracle ACE18 小时前
解读Oracle AWR报告:Global Cache and Enqueue Services - Workload Characteristics
数据库·oracle
流星白龙18 小时前
【Qt】7.信号和槽_connect函数用法(2)
java·数据库·qt
Zzz 小生20 小时前
Claude Code学习笔记(四)-助你快速搭建首个Python项目
大数据·数据库·elasticsearch
nongcunqq1 天前
abap 操作 excel
java·数据库·excel
rain bye bye1 天前
calibre LVS 跑不起来 就将setup 的LVS Option connect下的 connect all nets by name 打开。
服务器·数据库·lvs
冻咸鱼1 天前
MySQL的配置
mysql·配置
阿里云大数据AI技术1 天前
云栖实录|MaxCompute全新升级:AI时代的原生数据仓库
大数据·数据库·云原生
不剪发的Tony老师1 天前
Valentina Studio:一款跨平台的数据库管理工具
数据库·sql
weixin_307779131 天前
在 Microsoft Azure 上部署 ClickHouse 数据仓库:托管服务与自行部署的全面指南
开发语言·数据库·数据仓库·云计算·azure