sql - can we replace full join with union of left and right join? why not? -
can replace full join union of left , right join? if no,why?
'yes' if t1 , t2 sets (no duplicated rows), otherwise answer 'no'.
create table t1 (i int); create table t2 (i int); insert t1 values (1); insert t1 values (2); insert t1 values (2); insert t2 values (3);
full join
select * t1 full join t2 on t1.i=t2.i order 1,2
1 (null) 2 2 2 2 (null) 3
union
select * t1 left join t2 on t1.i=t2.i union select * t1 right join t2 on t1.i=t2.i order 1,2
1 (null) 2 2 (null) 3
union all
select * t1 left join t2 on t1.i=t2.i union select * t1 right join t2 on t1.i=t2.i order 1,2
1 (null) 2 2 2 2 2 2 2 2 (null) 3
Comments
Post a Comment