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;

相关推荐
SkyWalking中文站5 小时前
BanyanDB 0.11.0:新特性与升级指南
数据库
₍˄·͈༝·͈˄*₎◞ ̑̑码6 小时前
MyBatis操作数据库
数据库·mybatis
刃神太酷啦8 小时前
Redis 进阶核心:持久化 (RDB/AOF)、事务与主从复制全解析----《Hello Redis!》(5)
linux·c语言·数据库·c++·redis·缓存·bootstrap
丁丁点灯o8 小时前
Oracle中使用外键的场景及不适用外键的情况
数据库·oracle
天天进步20159 小时前
Pixelle-Video 源码解析 #18:声音克隆功能:参考音频如何影响解说效果?
数据库·音视频
不懂的浪漫9 小时前
ToDesk 连接 Linux 后分辨率过低的解决方法
linux·运维·数据库
布莱克6059 小时前
Redis 详解:从核心数据结构到高可用架构
数据库
冰暮流星10 小时前
mysql之左外连接与右外连接
数据库·sql
jyOverQ10 小时前
MySQL 联合索引怎么用?最左匹配原则到底是什么意思?
数据库·mysql
没文化的阿浩10 小时前
【MySQL】用户管理
android·mysql·adb