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