|
The value of field 1 in both tables cannot be duplicated
This means that the data of field 1 of table a cannot be the same as the data of field 1 of table b?
If so:
select field 1, field 2, field 3, '' as field 4 from table A
UNION
select field 1, field 2, '' as field 3, field 4 from table B
If that sentence means that the content of field 1 in table a or table b is not duplicated
select isnull (a.field1, b.field1), isnull (a.field2, b.field2), a.field3, b.field4
from table A a full join table B b
on a. field 1 = b. field 1 |
|