1. What is a subquery?When one query is part of another query, we call the inner query a subquery and the outer query the main query. 2. Where can subqueries appear?select ..(select). from ..(select). where ..(select). As can be seen from the above, subqueries often appear in three places: select can be followed by a subquery; from can be followed by a subquery; where can be followed by a subquery; we refer to them here as: 3. Where subqueryExercise: Find information about employees who earn above the average salary. 4. Use a subquery after from. (Too important)Exercise 1: Find the salary grade for the average salary in each department. The results are as follows: Exercise 2: Find the average salary level for each employee The results are as follows: Note: There are few scenarios where subqueries are used after select, so they will not be described here. If you feel it is necessary, you can go and check it out yourself. The above is the detailed content of the MySQL tutorial subquery example. For more information about MySQL subqueries, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: Simple tips to increase web page loading speed
>>: HTML simple shopping quantity applet
Adding a network interface to the container 1 Run...
Sometimes, we need to use the hyperlink <a> ...
Call How to call Amap API? The official open docu...
Preface In our daily development process, sorting...
The solution to the transparent font problem after...
Table of contents nonsense Functions implemented ...
If you forget your MySQL login password, the solu...
Table of contents 1. Form events 2. Mouse events ...
Table of contents 1. Problem 2. Solution 2.1 Pagi...
0. Background Hardware: Xiaomi Notebook Air 13/In...
Preface The essence of deadlock is resource compe...
The form code is as shown in the figure. The styl...
1. The significance of building nexus service As ...
Question How to access the local database in Dock...
Download the latest version of MySQL for Ubuntu L...