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;

相关推荐
成为大佬先秃头1 小时前
数据库连接池:Druid
数据库·mysql·druid
晓华-warm4 小时前
Warm-Flow 1.8.5 正式发布:超时自动审批、暂存功能来了!
数据库
u0136863825 小时前
将Python Web应用部署到服务器(Docker + Nginx)
jvm·数据库·python
light blue bird5 小时前
多页签Razor组支轴业务整顿组件
数据库·.net·ai大数据·多功能图表报表·web mvc + razor
wregjru5 小时前
【mysql】2.数据表操作
数据库·mysql
手握风云-5 小时前
基于 Java 的网页聊天室(三)
服务器·前端·数据库
LcVong5 小时前
MySQL 5.2/5.7 开启Binlog日志详细步骤(附验证+查看+恢复)
数据库·mysql·adb
FL4m3Y4n6 小时前
MySQL缓存策略
数据库·mysql·缓存
wsx_iot6 小时前
TDengine学习
数据库·学习·tdengine
不吃香菜的小趴菜6 小时前
mysql数据库打包与导入
数据库·mysql