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
相关推荐
数据库急诊室_阿哲3 小时前
一次加索引建议的复核记录:从报告到签字青瓦梦滋4 小时前
Redis主从复制慧都小妮子5 小时前
Wyn商业智能国产数据库适配:数据接入、分析缓存与审计日志验证清单Joy T6 小时前
Redis Lua 原子限流:Lua 脚本、竞态条件与并发控制杨凯凡6 小时前
MySQL 死锁怎么排查?InnoDB 锁等待与 Spring Boot 整事务重试实战Aloudata6 小时前
Claude 做数据分析的这两年:一份复盘与发展线索Decay__6 小时前
01_SQLServer 体系架构全解 —— 实例进程、关系引擎、SQLOS 与事务日志深入zhanghaha13147 小时前
C# 系列教程_12 字符串 string 保姆级系统教程(面向新手,大量示例 + 原理讲解)韩曙亮7 小时前
【错误记录】安卓 adb 调试 5037 端口占用排查 ( adb 的三层结构 | 找出本机占用 5037 的进程 )瑞雪兆丰年兮7 小时前
JavaWeb-day07-MySQL(DQL&多表设计)