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;
MySQL where条件
代码真的养发2023-11-05 9:47
相关推荐
swordbob12 分钟前
MySQL字符集陷阱:从Oracle迁移踩坑到utf8mb4强制规范牛油果子哥q26 分钟前
【C++ STL string 】C++ STL string 终极精讲:底层原理、内存机制、全套API、深浅拷贝、易错坑点与工程实战规范十五年专注C++开发27 分钟前
MySql中各种功能用sql语句实现总结数据库小学妹44 分钟前
AI时代数据库怎么选?多模融合、数据统一存储与选型实战指南Albert Edison1 小时前
【Redis】Centos7.9 安装 Redis 5 教程云计算磊哥@1 小时前
运维开发宝典026-MySQL02数据库表操作小二·1 小时前
Redis 内存溢出(OOM)排查与恢复实战pqk6V6Vep1 小时前
Redis 分布式锁进阶第一篇讲解giaz14n9X2 小时前
Redis 分布式锁进阶第六十一篇是一个Bug2 小时前
MongoDB:像搭积木一样存数据