select a,b from ta full join tb on ta.rowid=tb.rowid
楼上的老大,如果没有rowid这一列是不是不行呢?
没有就只好借用临时表: select *,identity(int,1,1) rowid into #a from ta select *,identity(int,1,1) rowid into #b from tb select a,b from #a full join #b on #a.rowid=#b.rowid
用一楼的方法很明显TA的最后两行显示不出来. 用二楼的方法报错:Unknown column 'sales.rowid' in 'on clause'
select *,identity(int,1,1) rowid into #a from ta
select *,identity(int,1,1) rowid into #b from tb
select a,b from #a full join #b on #a.rowid=#b.rowid
用二楼的方法报错:Unknown column 'sales.rowid' in 'on clause'