I have A table format below
| id value | |
| 1 | | A
| 2 | A |
| 3 | A |
Table B
Id value | |
| | | 5 B
6 | | | B
| | B |
| | B | 1
Table A and B connection how to write A SQL to form the following table structure
Id value
1 A
2 A
3 A
4 B
5 B
6 B
CodePudding user response:
Select * from aThe union
Select * from b
CodePudding user response:
Select * from aThe union
Select * from b
I can't
- + -- -- -- -- -- -- -- +
| id value | |
+ - + -- -- -- -- -- -- -- +
| 1 | | A
| | B |
| 2 | A |
6 | | | B
| | B | 1
| | | 5 B
| 3 | A | id 1, there are two
CodePudding user response:
Select * from aThe union
Select * from b where id not in (select id from a)
CodePudding user response:
Junction post rate: 0%