谁能帮我修改这条简单的sql语句,让它能在access环境下运行?在线等,马上给分!
Select isnull(isnull(A.f1,B.f1),C.f1) f1,A.F2,B.F3,C.F4 INTO D From A a Full Join B b ON A.F1 = B.F1 Full JOIN C c ON A.F1 = c.F1
表结构:
==========================
Table A:
F1 F2
1 6
2 1
Table B:
F1 F3
1 3
3 3
Table C:
F1 F4
5 4
6 2
Ok, the result i want is
Table D:
F1 F2 F3 F4
1 6 3 NULL
2 1 NULL NULL
3 NULL 3 NULL
5 NULL NULL 4
6 NULL NULL 2
问题点数:100、回复次数:4Top
1 楼year81s()回复于 2003-06-03 12:15:24 得分 0
select a.f1,b.f1,c.f1,d.f1 from a inner join b on a.f1=b.f1 inner join c on a.f1=c.f1 inner join d on c.f1=d.f1 where b.f1="" or c.f1="" or d.f1=""Top
2 楼rdsdh(方人也)回复于 2003-06-03 13:01:16 得分 100
SELECT T.F1,A.F2,B.F3,C.F4 From
(((Select F1 From A Union Select F1 From B Union Select F1 From C) T
Left Join A On T.F1 = A.F1)
Left Join B On T.F1 = B.F1)
Left Join C On T.F1 = C.F1
注:这里的别名T及括号等不能省。Top
3 楼rdsdh(方人也)回复于 2003-06-03 13:02:05 得分 0
SELECT T.F1,A.F2,B.F3,C.F4 INTO D
From
(((Select F1 From A Union Select F1 From B Union Select F1 From C) T
Left Join A On T.F1 = A.F1)
Left Join B On T.F1 = B.F1)
Left Join C On T.F1 = C.F1
注:这里的别名T及括号等不能省。Top
4 楼dancingfeather(飞羽)回复于 2003-06-03 13:23:52 得分 0
厉害!多谢!接分!Top




