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
相关推荐
考虑考虑6 小时前
数据库中的EXISTSWang's Blog6 小时前
Java框架快速入门: Spring Security+OAuth2之数据库和实体类的RBAC改造梦想平凡7 小时前
百游棋牌源代码开发搭建教程(十):隔离部署、备份恢复与双端验收xcLeigh8 小时前
让大模型长出手脚,自己写SQL查数据库(Function Calling初探)yume_sibai8 小时前
06-Rust Web 开发实战(Axum 框架 + 数据库 + JWT 认证 + 中间件 + 部署)AugustRed9 小时前
Neo4j 图数据库原理 + 应用场景简单介绍Gl�ria10 小时前
Redis 高可用架构对比IpdataCloud10 小时前
高可用的IP数据接口平台有哪些?从可用性、P99延迟到离线部署的评估框架(含代码)呆萌很10 小时前
MySQL 数据库和表的管理操作(命令行)毕业设计70311 小时前
(免费领源码)基于Python的博物馆研学活动管理系统的设计与实现22724- java、PHP、python、C#、小程序、大数据、单片机、网络工程等)