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
相关推荐
Mahir082 小时前
Redis 与 MySQL 数据同步:一致性保证的完整解决方案2301_769340672 小时前
如何在 Vuetify 中可靠捕获 Chip 关闭事件(包括键盘触发).txtAC赳赳老秦2 小时前
供应链专员提效:OpenClaw自动跟踪物流信息、更新库存数据,异常自动提醒·醉挽清风·3 小时前
学习笔记—MySQL—库表操作灵犀学长3 小时前
基于 Spring ThreadPoolTaskScheduler + CronTrigger 实现的动态定时任务调度系统北秋,3 小时前
PostgreSQL(Postgres)数据库基础用法 + 数字型 + 字符型 完整联合注入实战m0_596749094 小时前
JavaScript中手动实现一个new操作符的底层逻辑多加点辣也没关系4 小时前
Redis 的安装(详细教程)数据库小学妹4 小时前
数据库连接池避坑指南:告别“连接超时”与“资源耗尽”,让系统跑得更快!dishugj5 小时前
HANA 数据库备份与恢复