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 小时前
KingbaseES数据库:ksql 命令行用户与权限全攻略,从创建到删除华仔啊15 小时前
千万别给数据库字段加默认值 null!真的会出问题Hoffer_1 天前
MySQL 强制索引:USE/FORCE INDEX 用法与避坑Hoffer_1 天前
MySQL 索引核心操作:CREATE/DROP/SHOW随风飘的云2 天前
MySQL的慢查询优化解决思路IvorySQL2 天前
PostgreSQL 技术日报 (3月7日)|生态更新与内核性能讨论赵渝强老师2 天前
【赵渝强老师】金仓数据库的数据文件随逸1772 天前
《Milvus向量数据库从入门到实战,手把手搭建语义检索系统》神秘的猪头2 天前
🚀 React 开发者进阶:RAG 核心——手把手带你玩转 Milvus 向量数据库0xDevNull3 天前
MySQL索引进阶用法