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;

相关推荐
sunshine8858 小时前
财务RPA的深水区应用:超越自动化,迈向智能决策支持
数据库
efir OONA8 小时前
MySQL数据库误删恢复_mysql 数据 误删
数据库·mysql·adb
zhangchaoxies9 小时前
如何在 Go 中安全复制接口指针所指向的值
jvm·数据库·python
陈陈CHENCHEN9 小时前
【数据库】MySQL 8.0.40 至 8.0.44 RPM 方式升级指南
数据库·mysql
Azhao11069 小时前
一文读懂分享网站模块介绍(附实操教程)
mysql
m0_7349497910 小时前
怎么利用Navicat进行调整备份文件压缩等级_详细配置与操作步骤
jvm·数据库·python
T.i.s10 小时前
番外续2-MIT-BIH Arrhythmia Database
数据库
有味道的男人10 小时前
AI 效率翻倍:对接 1688 拍立淘接口,商品全量信息一键抓取
数据库
m0_7411733310 小时前
如何处理SQL中的NULL值_使用ISNULL或COALESCE函数
jvm·数据库·python
志栋智能11 小时前
超自动化巡检:解锁运维数据的深层价值
运维·服务器·数据库·自动化