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;

相关推荐
echola_mendes2 分钟前
Mac安装MongoDB数据库以及MongoDB Compass可视化连接工具
数据库·mongodb
安替-AnTi21 分钟前
基于python+Django+Mysql的校园二手交易市场
python·mysql·django
心想好事成39 分钟前
尚硅谷redis7 47-48 redis事务之理论简介
java·数据库·redis
静思心远1 小时前
ubuntu2x.xx网络不通如何解决
网络·数据库·postgresql
码上库利南1 小时前
详解MYSQL索引失效问题排查
数据库·mysql
遥遥领先zzl2 小时前
实时数仓flick+clickhouse启动命令
运维·服务器·数据库
Cachel wood2 小时前
Mysql常用知识3:Kafka和数据库优化
数据库·mysql·kafka
会敲键盘的猕猴桃很大胆2 小时前
Redis实战-缓存篇(万字总结)
java·数据库·spring boot·redis·缓存
不穿铠甲的穿山甲2 小时前
mysql-tpcc-mysql压测工具使用
linux·mysql·压测
敲键盘的小夜猫2 小时前
Milvus分区-分片-段结构详解与最佳实践
java·数据库·milvus