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
相关推荐
小冯不疯2 分钟前
查询旺店通货品策略实战教程:从源系统拉取到轻易云的端到端落地花间相见6 分钟前
【计算基础|MySQL18】Buffer Pool 与内存管理RacentCLM27 分钟前
HTTPS只在登录时有用?关于TLS的误解讲清杨云龙UP1 小时前
生产实战:Keepalived + Nginx + MySQL 双向复制高可用架构部署与原理详解代钦塔拉1 小时前
【C++/Qt 进阶】设计模式系列(7):过滤器模式——把“筛选条件“变成可组合的积木TDengine (老段)1 小时前
TDengine IDMP 十大亮点功能(一)为思念酝酿的痛1 小时前
MySQL的基本查询花间相见1 小时前
【计算基础|Redis01】【上手】安装连接、配置与通用命令geovindu1 小时前
Pivoting and Unpivoting Data in SQL using postgreSQL 18