sql - MS Access - alternative to performing a "full join" for columns with same name -
i have problem using access: using right + left outer joins overcome fact access not support full join.
select * t1 right outer join t2 on t1.xxx = t2.xxx union select * t1 left outer join t2 on t1.xxx = t2.xxx
on these tables:
t1: id1 | xxx | fielda 1 x b 2 y c 3 z t2: id2 | xxx | fieldb d 2 k e 3 j f 4 h
as result obtain table structure
t1.xxx | t2.xxx | fielda | fieldb | id1 | id2 1 x 2 2 y k b d 3 3 z j c e 4 h f
xxx not primary key has same name , numerical type (integer)
i saw many other places should work collapsing 2 tables! here not (the elements on same rows, when non blank, of course same)
my expectation
final table: xxx | id1 | id2 |fielda | fieldb 1 x 2 b d y k 3 c e z j 4 f h
it seems there different set of column values both of these 2 tables, having t1.xxx
, t2.xxx
have same values, other columns dont, union
in case wouldn't combine these 2 records
try like
select t1.xxx t1 right outer join t2 on t1.xxx = t2.xxx union select t2.xxx t1 left outer join t2 on t1.xxx = t2.xxx
something should give xxx
values table 1 , table 2, ignoring duplicate
values xxx
.
Comments
Post a Comment