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;

相关推荐
hanbr17 小时前
Qt:事件处理与绘图详解
开发语言·数据库·qt
weixin_4440129317 小时前
Go语言怎么防SQL注入_Go语言SQL注入防护教程【深入】
jvm·数据库·python
爱编程的小新☆17 小时前
Langchain4j对话记忆
数据库·缓存·持久化存储·langchain4j
m0_4708576417 小时前
C#怎么实现蓝牙设备搜索_C#如何开发Bluetooth应用【指南】
jvm·数据库·python
曦夜日长17 小时前
Linux系统篇,开发工具(三):文件翻译的思路重构、库的深入理解、文件链接时区别与细节
linux·数据库·重构
2303_8212873817 小时前
在 Go 中声明包级全局 Map 的正确方法
jvm·数据库·python
老纪17 小时前
CSS移动端如何实现平滑滚动效果_设置scroll-behavior smooth属性.txt
jvm·数据库·python
johnny23317 小时前
数据库客户端:PRQL、rainfrog、WhoDB、GoNavi、Dory、FXDB
数据库
Java成神之路-17 小时前
面试题:联合索引的结构
mysql
anew___17 小时前
SQL实战复盘:如何优雅地抛弃 JOIN 关键字?
数据库