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;

相关推荐
__风__12 分钟前
PostgreSQL kv(jsonb)存储
数据库·postgresql
Databend18 分钟前
Databend 产品月报(2025年6月)
数据库
Little-Hu1 小时前
QML TextEdit组件
java·服务器·数据库
保持学习ing3 小时前
day1--项目搭建and内容管理模块
java·数据库·后端·docker·虚拟机
发仔1234 小时前
Oracle与MySQL核心差异对比
mysql·oracle
宇钶宇夕4 小时前
EPLAN 电气制图:建立自己的部件库,添加部件-加SQL Server安装教程(三)上
运维·服务器·数据库·程序人生·自动化
爱可生开源社区4 小时前
SQLShift 重磅更新:支持 SQL Server 存储过程转换至 GaussDB!
数据库
贾修行5 小时前
SQL Server 空间函数从入门到精通:原理、实战与多数据库性能对比
数据库·sqlserver
傲祥Ax5 小时前
Redis总结
数据库·redis·redis重点总结
一屉大大大花卷6 小时前
初识Neo4j之入门介绍(一)
数据库·neo4j