有三张表,A,B, CA大概1000多条数据,C有60000多条要求通过A中的数据找到B中匹配的,然后在根据B中符合要求的一个字段找到C中匹配的数据,A中数据要求全部显示,未匹配的保留
select A.A1,C.C2 from A,B,C where A.A1=B.B1(+) and B.B2=C.C1(+)
这样执行的话很慢select a1,C.C2 (select A.A1 as a1,B.B2 as a2 from A,B where where A.A1=B.B1(+)) aa,C
where aa.B2=C.C1(+)
这么执行还可以