日期:2014-05-18  浏览次数:20462 次

各位大哥大姐帮帮小弟,关于表连接的问题,谢谢a !
表A
id
1
2
表B
id
1
3
表C
id
4
5
-------------------------
请问怎么连接,结果就是:
id
1
2
3
4
5
-------------------

帮帮忙啊!

------解决方案--------------------
SQL code

select * from a
union
select * from b
union
select * from c

------解决方案--------------------
SQL code

select a.id aid,b.id bid,c.id cid
from (select * from @表A where id = 2) a full join @表B b on a.id = b.id
            full join @表C c on a.id = c.id