One of the SQL Master tables records multiple record statements corresponding to the schedule
Like this, we use the
Union statement
SQL Union syntax
Select column_name (s) from table_name1
Union
Select COLUMN_NAME (s) from Table_name2
Join left statement
LEFT JOIN keyword syntax
Select column_name (s)
From table_name1
Left JOIN Table_name2
On Table_name1.column_name=table_name2.column_name
where child query
SELECT * from a b where a.id=b.id
Here, let's look at an example.
Select XXXX from main Table INNER join schedule on Main table. xxxx= schedule. xxxx where xxxx
Example Description.
Employees_china:
e_id E_name
Zhang, Hua
Wang, Wei
Carter, Thomas
Yang, Ming
Employees_usa:
e_id E_name
Adams, John
Bush, George
Carter, Thomas
Gates, Bill.
List all the different employee names in China and the United States:
Select E_name from Employees_china
Union
Select E_name from Employees_usa
Results
E_name
Zhang, Hua
Wang, Wei
Carter, Thomas.
Yang, Ming
Adams, John.
Bush, George.
Gates, Bill.