想从table1,table2两张表中同时选出code,name不同的项,但是下面的语句只能以table1为主,选出table2中没有,怎样能同时选出table1中没有的或者table2中没有的呢?
select t.code, t.name, a.code, a.name
from table1 t
left join table2 a
on t.code = a.code
order by t.code
在线等
select t.code, t.name, a.code, a.name
from table1 t
left join table2 a
on t.code = a.code
order by t.code
在线等
from table1 t
full outer join table2 a
on t.code = a.code
order by t.code
from table1 t
full join table2 a
on t.code = a.code
order by t.code