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
相关推荐
施嘉伟6 分钟前
Oracle 在线重定义卡了一个多小时:查不到阻塞会话꯭自꯭闭꯭8 分钟前
达梦守护集群手工切换及故障切换j7~10 分钟前
【Redis初阶】(篇二)《一文吃透 Redis:特性、应用场景、版本演进与安装配置全解析》Elastic 中国社区官方博客35 分钟前
使用 NVIDIA cuVS 在 Elasticsearch 中实现 GPU 加速的向量索引:在 10 分钟内处理 1.38 亿个向量我们从未走散1 小时前
AI 生图平台如何避免资损:用“扣款与凭据同事务”构建三态账本Shadow(⊙o⊙)2 小时前
MySQL复合查询L·S·P7 小时前
25MB 管理 100+ 种数据库:开源轻量客户端 DBX 介绍与上手笃行3509 小时前
KingbaseES KSQL Developer 的连接管理、数据处理与对象管理ha_lydms9 小时前
MaxCompute中加密与解密函数Shadow(⊙o⊙)10 小时前
MySQL内置函数