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
相关推荐
哆啦A梦15884 小时前
Springboot整合MyBatis实现数据库操作Zzzzmo_4 小时前
【MySQL】JDBC(含settings.xml文件配置/配置国内镜像以及pom.xml文件修改)FirstFrost --sy5 小时前
MySQL内置函数2401_879693875 小时前
将Python Web应用部署到服务器(Docker + Nginx)reembarkation5 小时前
光标在a-select,鼠标已经移出,下拉框跟随页面滚动eggwyw5 小时前
MySQL-练习-数据汇总-CASE WHEN星轨zb5 小时前
通过实际demo掌握SpringSecurity+MP中的基本框架搭建treacle田6 小时前
达梦数据库-配置本地守护进程dmwatcher服务-记录总结wyt5314296 小时前
Redis的安装教程(Windows+Linux)【超详细】CeshirenTester6 小时前
从数据库到结构化用例:一套可落地的测试智能体架构