Existing Oracle Table A table B
ID COLA ID COLB
1 1 2 4
2 2 3 5
3 3 4 6
Full JOIN operation for table A and table B sql1:select t.id,cola,colb from (SELECT * from A) T fully Join (SELECT * from B) R on T.id=r.id
The result is ID COLA COLB
1 1
2 2 4
3 3 5
6 because the SQL1 selected is T.id (that is, the ID of a), so the full connection after the connection field will only display the ID of a, and B's ID is null
Similarly, if you choose r.id (that is, the ID of B) The result is that the ID of a is null Sql2:select r.id,cola,colb from (SELECT * from A) T full JOIN (SELECT * from B) R on T. Id=r.id
ID COLA COLB
1
2 2 4
3 3 5
4 6
The result table is processed to Sql3:select a| | B as Id,cola,colb from (select T.id as a,r.id as B,cola,colb from (SELECT * from A) T full JOIN (SELECT * from B) R on T.I D=r.id) WHERE A is null OR B was null UNION all SELECT A as Id,cola,colb from (select T.id as a,r.id as B,cola,colb FRO M (SELECT * from A) T full JOIN (SELECT * from B) R-t.id=r.id) WHERE A is isn't null and B is NOT NULL
Get the ID in table a table B alias a B, and then merge the AB column into 1 column ID, that is, AB is not empty then take one of them, the Union AB has an empty, take a| | b You can
A B COLA COLB
1 1
2 2 2 4
3 3 3 5
4 6
Finally get
ID COLA COLB
1 1
2 2 4
3 3 5
4 6
Oracle Full connection processing connection field display not complete problem