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;

相关推荐
小猿姐11 分钟前
Clickhouse Kubernetes Operator 实测:哪种方案更适合生产?
运维·数据库·kubernetes
2501_9219392632 分钟前
MHA高可用
数据库·mysql
_Evan_Yao1 小时前
MySQL 基础:SELECT、WHERE、JOIN 的第一次使用
数据库·mysql
weixin_444012932 小时前
c++如何将std--vector直接DUMP到二进制文件_指针地址直写【附代码】
jvm·数据库·python
woxihuan1234562 小时前
Go语言中--=运算符详解:位右移赋值操作的原理与应用
jvm·数据库·python
java1234_小锋2 小时前
SpringBoot为什么要禁止循环依赖?
java·数据库·spring boot
神仙别闹3 小时前
基于QT(C++)实现学生成绩管理系统
数据库·c++·qt
m0_690825823 小时前
如何备份被破坏的数据表_强制跳过错误的导出尝试
jvm·数据库·python
tongyiixiaohuang3 小时前
轻易云平台助力快麦数据入库MySQL
android·数据库·mysql
残 风3 小时前
快速理解什么是MVCC?
数据库·postgresql·oracle·数据库开发