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
相关推荐
春风霓裳7 分钟前
sql-窗口函数言之。14 分钟前
【数据库】TiDB 技术选型与架构分析报告人工智能训练40 分钟前
如何在 Ubuntu 22.04 中安装 Docker 引擎和 Linux 版 Docker Desktop 桌面软件胖头鱼的鱼缸(尹海文)1 小时前
数据库管理-第386期 使用OCP部署OceanBase 4.4.1社区版集群(20251107)Craaaayon1 小时前
如何选择两种缓存更新策略(写缓存+异步写库;写数据库+异步更新缓存)一 乐1 小时前
点餐|智能点餐系统|基于java+ Springboot的动端的点餐系统小程序(源码+数据库+文档)WarriorTan1 小时前
理解PostgreSQL中的数据块学好statistics和DS1 小时前
三个好思路:SQL并行化处理、混淆矩阵和特征交叉唐僧洗头爱飘柔95272 小时前
【GORM(3)】Go的跨时代ORM框架!—— 数据库连接、配置参数;本文从0开始教会如何配置GORM的数据库谅望者2 小时前
在 macOS 上使用 Homebrew 安装 MySQL 8.0 完整指南