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;

相关推荐
瀚高PG实验室10 小时前
ETL中,分区表子表未及时收集统计信息,导致sql执行耗时很长
数据库·数据仓库·sql·etl·瀚高数据库
LDG_AGI10 小时前
【搜索引擎】Elasticsearch(二):基于function_score的搜索排序
数据库·人工智能·深度学习·elasticsearch·机器学习·搜索引擎·推荐算法
枫叶林FYL10 小时前
【自然语言处理 NLP】7.2.2.4 去偏见技术与公平性优化
数据库
星川水月10 小时前
SQL 开窗函数排序详解
数据库·sql
荒川之神10 小时前
Oracle 数据仓库雪花模型设计原则(核心 + 落地 + Oracle 数据库适配)
数据库·数据仓库·oracle
_下雨天.10 小时前
Python 操作 MySQL 数据库
数据库
VIV-11 小时前
医院病房管理系统的数据库设计(SQL Server)
数据库·sql·sqlserver
荒川之神11 小时前
Oracle 数据仓库星型模型设计原则
数据库·数据仓库·oracle
Chasing__Dreams11 小时前
Mysql--基础知识点--96--count * VS count 列
数据库·mysql
子木HAPPY阳VIP11 小时前
【无标题】
java·python·mysql