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;

相关推荐
Data_Journal1 小时前
用于网页抓取的 Node-unblocker
大数据·开发语言·数据库·python·scrapy
涤生大数据1 小时前
一次“没有运行日志”的DolphinScheduler任务失败排查
大数据·数据库·人工智能·状态模式
专注API从业者1 小时前
告别人工盯品!借助 Open Claw 搭建电商商品自动化监控与数据分析系统(完整可运行源码)
大数据·运维·数据库·数据分析·自动化
viskaz2 小时前
数据库迁移流程学习
数据库
auspicious航2 小时前
PostgreSQL写入慢全攻略:原因排查与性能调优实战
数据库·postgresql
IvorySQL3 小时前
PostgreSQL 日报|逻辑复制行过滤致数据丢失(8 月 21 日)
数据库·postgresql
重生之我是Java开发战士3 小时前
【Java EE】事务与事务的传播机制
数据库·java-ee
润乾软件3 小时前
Trae+SQLazy 编写复杂 SQL 实践
数据库·sql
会编程的吕洞宾3 小时前
Redis大Key拖垮线上?排查定位与治理实战
数据库·redis·bootstrap
呆呆小孩3 小时前
零基础学 MySQL(上):从建库建表到增删改查,一篇搭好 SQL 基础
android·sql·mysql