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
相关推荐
v***91302 小时前
【MySQL】JDBC的连接j***51892 小时前
Redis 安装及配置教程(Windows)【安装】A***F1575 小时前
Redis开启远程访问v***44675 小时前
【MySQL — 数据库基础】深入理解数据库服务与数据库关系、MySQL连接创建、客户端工具及架构解析v***59835 小时前
Django视图与URLs路由详解tg-zm8899965 小时前
2025返利商城源码/挂机自动收益可二开多语言/自定义返利比例/三级分销理财商城i***48615 小时前
MySQL中的GROUP_CONCAT()函数详解与实战应用K***43065 小时前
MySQL中的TRUNCATE TABLE命令tyatyatya5 小时前
MATLAB图形标注教程:title()/xlabel()/ylabel()/legend()/grid on全解析e***95646 小时前
DBeaver连接本地MySQL、创建数据库表的基础操作