MySQL where条件

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;

相关推荐
马克学长13 分钟前
SSM学生综合考评系统b8vlm(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面
数据库·ssm 框架·学生综合考评系统·高校学生管理、
独自破碎E32 分钟前
MySQL中如何进行SQL调优?
数据库·sql·mysql
laplace01231 小时前
第八章 agent记忆与检索 下
数据库·人工智能·笔记·agent·rag
MyselfO(∩_∩)O1 小时前
1148. 文章浏览 I
数据库
少云清1 小时前
【性能测试】10_JMeter _JMeter连接数据库(重点)
数据库·jmeter
程序员敲代码吗1 小时前
使用Python进行PDF文件的处理与操作
jvm·数据库·python
小光学长1 小时前
基于SSM的个人健康系统26vxdh02(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
数据库
林九生2 小时前
【MySQL/PostgreSQL】MySQL 到 PostgreSQL 数据迁移:Docker + pgloader
mysql·docker·postgresql
mit6.8242 小时前
sql窗口函数
数据库
七七七七072 小时前
【Redis】Ubuntu22.04安装redis++
数据库·redis·缓存