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;

相关推荐
稚辉君.MCA_P8_Java2 小时前
JVM第二课:一文讲透运行时数据区
jvm·数据库·后端·容器
阳光明媚sunny3 小时前
Room持久化库中,@Transaction注解的正确使用场景是?
android·数据库
北极糊的狐4 小时前
MySQL常见报错分析及解决方案总结(15)---Can’t connect to MySQL server on ‘localhost‘ (10061)
数据库·mysql
濑户川4 小时前
Django5 与 Vue3 表单交互全解析:从基础到实战
数据库
weixin_438077494 小时前
langchain官网翻译:Build a Question/Answering system over SQL data
数据库·sql·langchain·agent·langgraph
陈一Tender5 小时前
JavaWeb后端实战(MySql基础)
mysql
-雷阵雨-5 小时前
MySQL——数据库操作攻略
数据库·mysql
krielwus5 小时前
Oracle ORA-01653 错误检查以及解决笔记
数据库·oracle
Wadli5 小时前
csdn| MySQL
数据库·mysql
程序员水自流5 小时前
MySQL InnoDB存储引擎关键核心特性详细介绍
java·数据库·mysql