求一关于外连接的语句.
表a2:
id a
1 12
2 13
表b2:
id b
1 12
2 null
3 null
想得到如下结果:(a2.id=b2.id)
id a b
1 12 12
2 13 null
请各位高手帮一下忙!最好是使用外连接来完成.谢谢!
问题点数:20、回复次数:5Top
1 楼leeboyan(宝宝)回复于 2004-09-03 18:26:30 得分 10
select a.*,b.b from a2 a left join b2 b on a.id=b.idTop
2 楼hdhai9451(☆新人类☆)回复于 2004-09-03 18:33:27 得分 10
select a.id,a.a,b.b from a2 a inner join b2 b on a.id=b.id
Top
3 楼luckljtchinaren(Lucky)回复于 2004-09-03 18:37:16 得分 0
谢谢!Top
4 楼jackting()回复于 2004-09-03 18:37:22 得分 0
select t1.*,t2.b
from a2 t1,b2 t2
where t1.ID*=t2.IDTop
5 楼luckljtchinaren(Lucky)回复于 2004-09-03 18:40:01 得分 0
to:hdhai9451(※★山,快馬加鞭未下鞍...☆※)
请问,内联接也可联接null值的吗?有点疑惑!Top




