Home > database >  For help how to implement the following this effect
For help how to implement the following this effect

Time:10-10


As shown in figure, with the select filter table 1 table 2 two tables of data, achieve the effect of table 3
How to write

CodePudding user response:

In the name column full join

CodePudding user response:

 select a.n ame, b.g rade1, c.g rade2 from 
(select distinct name from table 1
Union all
Select distinct name from table 2.) a
Left the join table 1 b on a.n ame=b.n ame
Left the join table 2 c on a.n ame=c.n ame

CodePudding user response:

 select NVL (t1. Id, t2. Id), NVL (t1) name, t2. The name), t1. Grade1, t2. Grade2 
The from tab1 t1 full join tab2 t2 on t1. The name=t2. The name
;
  • Related