c表建索引(c2,c1)
用临时表:
select c1,max(c2) as c2 
into #Temp
from c where c2 <='2002010101010101'
group by c1select a.a1,a.a2,b.b1,c.c1,c.c2,c.c3
 from a,b,c,#temp x 
where a.a1=b.b1 and c.c1=a.a1 
and c.c1=x.c1 and c.c2=x.c2