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