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
相关推荐
GuWenyue1 小时前
Cursor黑盒拆解!1套LangChain.js手写Mini编程Agent,自动生成React项目,效率提升60%Miao121313 小时前
某海外住宿平台如何在大规模场景下实现指标一致性:Minerva 指标平台实践CodexDave3 小时前
MySQL事务隔离级别与MVCC机制解析碎光拾影3 小时前
ARM交叉工具链各工具作用及IMX6ULL平台LED+蜂鸣器裸机程序实现曾阿伦3 小时前
MongoDB 查询语句备忘手册一叶龙洲4 小时前
wslg打开Ubuntu24.04默认打开图形界面CCPC不拿奖不改名4 小时前
大模型推理架构与开源生态知识整理爬也要爬着前进5 小时前
redis主从搭建@Mike@6 小时前
02-数据库学习笔记(SQL引擎)王琦03186 小时前
生产环境中使用通用二进制包安装