当前位置:网站首页>Introduction and advanced MySQL (13)
Introduction and advanced MySQL (13)
2022-07-29 03:09:00 【Xiaoxinai programming】
Exist as a condition at the location of the query condition
A. send ⽤in
Eg1: Check the students who failed the exam ⽣ list
B. send ⽤not in
Eg2: The query is not based on C language ⾔ Understand the learning of software programming exam ⽣ list
– A. Use in
– Eg1: Check the list of students who failed the exam
select studentid from exam where exam<60
select * from studentinfo where studentid in(
select studentid from exam where exam<60
)
– B. Use not in
– Eg2: The query is not based on C List of students for language understanding software programming exam
select * from subject where subjectname=‘ be based on C Language understanding software programming ’
select studentid from exam where subjectid=1
select * from studentinfo where studentid not in(
select studentid from exam where subjectid=(
select subjectid from subject where subjectname=‘ be based on C Language understanding software
Programming ’) )
C. send ⽤all
Eg3: Query results ⽐“C003” this ⻔ Any grade in the course is ⼤ Science ⽣ Test information .
D. send ⽤any
Eg4: Query results ⽐“C003” this ⻔ One of the courses ⼀ Achievements ⾼ Science ⽣ Test information
C. Use all: all >all( Subquery , The return value is multiple rows and one column ),
If the value is greater than all in the sub query results true It should be displayed, otherwise it will not be displayed :>max Eg3: Query score ratio “ be based on C Language understanding software programming ” Examination information of students whose grades are high in this course .
select * from `subject` where subjectname=' be based on C Language understanding software programming '
select * from exam where subjectid=1
select * from exam where exam>all(
select exam from exam where subjectid=(
select subjectid from `subject` where subjectname=' be based on C Language understanding software
Programming '));
select * from exam where exam>(
select max(exam) from exam where subjectid=(
select subjectid from `subject` where subjectname=' be based on C language
Understand software programming '))
-- D. Use any: arbitrarily ,>any( Subquery ) : Greater than any value in the subquery ,>min
-- Eg4: Query score ratio “C003” Examination information of a student with high scores in this course
select * from exam where exam>any(
select exam from exam where subjectid=(
select subjectid from `subject` where subjectname=' be based on C Language understanding software
Programming ' );
select * from exam where exam>(
select min(exam) from exam where subjectid=(
select subjectid from `subject` where subjectname=' be based on C language
Understand software programming ' ) );
边栏推荐
- Available data sets for scene classification tasks (part)
- navicat新建数据库
- Self study notes on Apache file management -- mapping folders and configuring Apache virtual machines based on single IP and multi domain names
- 万字详解 Google Play 上架应用标准包格式 AAB
- C陷阱与缺陷 第3章 语义“陷阱” 3.8 运算符&&、||和!
- 明明开发薪资高,为什么我还是选了测试?
- 三子棋(玩家+电脑)
- Add a row to a specific location in the dataframe
- SAP 中国本地化内容汇总
- codeforces每日5题(均1500)-第二十五天
猜你喜欢

JVM基础入门篇一(内存结构)

融云实时社区解决方案

Alibaba Sentinel - 工作流程及原理解析

Navicat new database

VASP calculation task error: M_ divide:can not subdivide 8 nodes by 6

Digital image processing Chapter 10 - image segmentation

Engineering boy: under 20 years old, ordinary but not mediocre

Multi table (Association) query of SQL query data

【C】数组

SQL查询数据之多表(关联)查询
随机推荐
Typescript学习(一)
美联储再加息,75基点 鲍威尔“放鸽”,美股狂欢
[NPM error] - NPM err code eresolve and NPM err eresolve could not resolve problems
Li Shuo, vice president of Baidu: it's a good thing that China's labor costs rise with the support of digital technology
Redis配置缓存过期监听事件触发
MYCAT read / write separation configuration
codeforces每日5题(均1500)-第二十五天
Verilog:阻塞赋值和非阻塞赋值
C陷阱与缺陷 第2章 语法“陷阱” 2.6 “悬挂”else引发的问题
Navicat new database
What if MySQL forgets the password
13_ UE4 advanced_ Montage animation realizes attack while walking
"PHP Basics" output approximate value of PI
数字图像处理 第10章——图像分割
C language small project - address book (static version + dynamic version + file version)
Production deployment zabbix5.0 notes
增量实时灾备笔记
【机器人学习】机械臂抓手matlab运动学与admas动力学分析
Mongodb index (3)
融云 IM & RTC 能力上新盘点