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
相关推荐
字节跳动数据库34 分钟前
火山引擎缓存数据库:如何构建超大规模缓存集群的无感弹性能力SelectDB41 分钟前
多模态检索用什么数据库?向量、全文与 SQL 混合检索选型指南旋风菠萝2 小时前
HashMap和CurrentHashMap的key可以为空吗开开心心就好3 小时前
PDF水印怎么去掉?勾选对象再点匹配隔窗听雨眠3 小时前
数据管理系统弹性调度的资源模型与实战路径Nturmoils3 小时前
数据库选型 POC:订单系统怎么验收候选CoderYanger6 小时前
Java EE 进阶:9.MyBatis 操作数据库(进阶)(第一弹)csdn_aspnet8 小时前
Docker 啟動MySQL Server連上MySQL Workbench隔窗听雨眠18 小时前
SQL执行计划固化的原理与稳定性工程TDengine (老段)20 小时前
TDengine IDMP 功能点—数据接入