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;

相关推荐
不剪发的Tony老师8 分钟前
sqlectron:一款轻量级的SQL客户端
数据库·sql
酸菜牛肉汤面12 分钟前
7、索引设计的原则
数据库
薛不痒22 分钟前
使用python操作MySQL
数据库·mysql
TG:@yunlaoda360 云老大28 分钟前
华为云国际站代理商VIAS主要有什么作用呢?
数据库·人工智能·华为云
回忆是昨天里的海31 分钟前
Spring boot接入视图时的问题
mysql·mybatisplus·视图
云和数据.ChenGuang31 分钟前
openeuler下的git指令集合
linux·运维·数据库·centos
一 乐33 分钟前
养老院信息|基于springboot + vue养老院信息管理系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·后端
cike_y36 分钟前
Mybatis之作用域(Scope)和生命周期-解决属性名和字段名不一致的问题&ResultMap结果集映射
java·开发语言·数据库·tomcat·mybatis
液态不合群40 分钟前
【面试题】MySQL 中的索引数量是否越多越好?为什么?
android·数据库·mysql
imbackneverdie43 分钟前
2025国自然资助率12.29%创新低!2026年如何用数据与AI“破局”?
数据库·人工智能·自然语言处理·aigc·ai写作·课题·国家自然科学基金