MySQL where条件

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;

相关推荐
无奈笑天下26 分钟前
银河麒麟桌面OS使用分区编辑器将/backup分区删除并扩容至根分区参考教程
linux·数据库·经验分享·编辑器
tzhou644527 小时前
MySQL备份与恢复
数据库·mysql·adb
一过菜只因7 小时前
MySql Jdbc
android·数据库·mysql
思成不止于此7 小时前
MySQL 查询实战(三):排序与综合练习
数据库·笔记·学习·mysql
茅坑的小石头7 小时前
数据库表设计,概念模型、逻辑模型、物理模型的区别,目标、主要内容、所处阶段、面向人群,数据库无关性
数据库
tebukaopu1487 小时前
mysql数据备份还原
数据库·mysql
zyxqyy&∞7 小时前
mysql代码小练-2
数据库·mysql
JIngJaneIL8 小时前
基于Java非遗传承文化管理系统(源码+数据库+文档)
java·开发语言·数据库·vue.js·spring boot
+VX:Fegn08958 小时前
计算机毕业设计|基于springboot + vue心理健康管理系统(源码+数据库+文档)
数据库·vue.js·spring boot·后端·课程设计
poemyang8 小时前
像Git一样管理数据:深入解析数据库并发控制MVCC的实现
mysql·事务·mvcc