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
相关推荐
forEverPlume3 分钟前
mysql如何实现高可用集群架构_基于MHA环境搭建与部署草莓熊Lotso1 小时前
Vibe Coding 时代:LangChain 与 LangGraph 全链路解析zh1570236 小时前
JavaScript中WorkerThreads解决服务端计算瓶颈代码AI弗森6 小时前
一文理清楚“算力申请 / 成本测算 / 并发评估”摇滚侠7 小时前
expdp 查看帮助流年似水~7 小时前
MCP协议实战:从零搭建一个让Claude能“看见“数据库的工具服务2401_871492858 小时前
Vue.js监听器watch利用回调函数处理级联下拉框数据联动志栋智能8 小时前
超自动化安全:构建智能安全运营的核心引擎zhoutongsheng9 小时前
C#怎么实现Swagger文档 C#如何在ASP.NET Core中集成Swagger自动生成API文档【框架】WinterKay9 小时前
【开源】我写了一个轻量级本地数据库浏览工具,支持 MySQL/Redis 只读查询