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
相关推荐
Coder_Boy_5 小时前
技术让开发更轻松的底层矛盾helloworldandy5 小时前
使用Pandas进行数据分析:从数据清洗到可视化数据知道7 小时前
PostgreSQL 故障排查:如何找出数据库中最耗时的 SQL 语句qq_12498707537 小时前
基于SSM的动物保护系统的设计与实现(源码+论文+部署+安装)枷锁—sha7 小时前
【SRC】SQL注入WAF 绕过应对策略(二)Coder_Boy_7 小时前
基于SpringAI的在线考试系统-考试系统开发流程案例Gain_chance7 小时前
35-学习笔记尚硅谷数仓搭建-DWS层最近n日汇总表及历史至今汇总表建表语句此生只爱蛋7 小时前
【Redis】主从复制马猴烧酒.8 小时前
【面试八股|JAVA多线程】JAVA多线程常考面试题详解天天爱吃肉82188 小时前
跟着创意天才周杰伦学新能源汽车研发测试!3年从工程师到领域专家的成长秘籍!