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;

相关推荐
罗政2 小时前
PDF 批量合并工具:本地 AI 自动排序、识别正文日期与合同编号
数据库·pdf·php
SelectDB3 小时前
宽表元数据膨胀怎么解?Doris Segment V3 对比 Parquet、Lance
大数据·数据库·数据分析
曹牧3 小时前
Oracle:快速定位最新数据
数据库·oracle
AskHarries3 小时前
PostgreSQL 还是 MySQL
mysql·postgrel
Zhu7584 小时前
在Docker环境部署ApacheGuacamole,对接PG数据库
数据库·docker·容器
Leighteen4 小时前
Redis与MySQL双写一致性:从问题根源到工程落地
数据库·redis·mysql
AI-好学者5 小时前
阶段二-Cypher查询语言详解
数据库·rag·graphrag
龙仔7255 小时前
SQL Server 批量多库只读账号一键脚本(带逐行注释完整脚本 + 分段逐句详细解释)
服务器·数据库·sql·sqlserver·dba
咏方舟【长江支流】6 小时前
【开源】跨语言·跨平台·跨数据库(2) —— 用宝轻量框架设计必读
数据库·架构·开源·ai编程·咏方舟-长江支流·用宝框架