把distinct 换成group by select  x.A,x.B,p.C,p.D,f.E
from Pkgmain p,fabmain f,#x x
where x.A=p.A and x.B=p.B and p.C=f.c 
group by x.A,x.B,p.C,p.D,f.E
order by x.sppono,x.sproductno

解决方案 »

  1.   

    pkgmain的a ,c 
    fabmain的c
    #x的a,b建索引
      

  2.   

    19191919(红围巾)
    换group by 怎么个换法?给我写一下好吗?
    还有索引我已经建了
      

  3.   

    再贴一遍select  x.A,x.B,p.C,p.D,f.E
    from Pkgmain p,fabmain f,#x x
    where x.A=p.A and x.B=p.B and p.C=f.c group by x.A,x.B,p.C,p.D,f.Eorder by x.sppono,x.sproductno一般选择非重复项,数据多的时候,distinct 很慢,不如利用group by 的分组了
      

  4.   

    19191919(红围巾)不好意思
    刚才我换成group by 了可还是不行啊,还需要7秒钟。happydreamer(小黑) 我该做怎么样的改进呀,请多指教!