Use an SQL statement to obtain the results and extract the data in the format listed in table3 from table1 and table2. Note that the provided data and results are not accurate, but you can ask for advice as a format. You can also use the stored procedure. Table July mon Department dep performance yj ----------------------------------- July 0110 July 0210 July
Use an SQL statement to obtain the results and extract the data in the format listed in table3 from table1 and table2. Note that the provided data and results are not accurate, but you can ask for advice as a format. You can also use the stored procedure. Table July mon Department dep performance yj ----------------------------------- February 01 10 February 02 10 February
Use an SQL statement to obtain the result.
Retrieve the data in the format listed in table3 from table1 and table2. Note that the provided data and results are not accurate, but you can ask for advice as a format.
You can also use the stored procedure.
Table1
Month mon Department dep performance yj
-------------------------------
February 01 10
February 02 10
March January
March 02 8
March February
March
Table 2
Department dep Department name dname
--------------------------------
01 domestic business 1
02 domestic business department 2
03 domestic business department 3
04 International Business Department
Table3 (result)
Department dep, January, January
--------------------------------------
01 10 null
02 10 8 null
03 5 null 8
04 null 9 null
------------------------------------------
<无>
Select dname, B. yj'february ', c. yj'february ', d. yj'february 'from table2 a left join table1 B on. dep = B. dep and B. mon = 'february 'left join table1 c on. dep = c. dep and c. mon = 'february 'left join table1 d on. dep = d. dep and d. mon = 'february'