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;

相关推荐
清风徐来QCQ2 小时前
Lombok/SSM/devTools
数据库
LaughingZhu2 小时前
Product Hunt 每日热榜 | 2026-04-05
前端·数据库·人工智能·经验分享·神经网络
2601_949814693 小时前
使用mysql报Communications link failure异常解决
数据库·mysql
搜佛说3 小时前
02-第2章-核心概念与架构
数据库·物联网·微服务·架构·边缘计算·iot
#六脉神剑4 小时前
MySQL参数调优:十个关键参数助力数据库性能数倍提升
运维·mysql
C'ᴇsᴛ.小琳 ℡4 小时前
高性能NoSQL
数据库·nosql
i220818 Faiz Ul5 小时前
动漫商城|基于springboot + vue动漫商城系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·论文·毕设·动漫商城系统
iNgs IMAC5 小时前
redis 使用
数据库·redis·缓存
bearpping5 小时前
MySQL压缩版安装详细图解
android·mysql·adb
TDengine (老段)7 小时前
TDengine IDMP 可视化 —— 面板
大数据·数据库·人工智能·物联网·ai·时序数据库·tdengine