|
由于工作需要,我要在几个表来联合查询,得出结果,但是我写出来的语句查询速度非常慢,汗。不知道哪位可以指点一下?其中一个SQL语句如下:
SELECT CELTCHFP.EXCHID,CELTCHFP.DATE,CELTCHFP.PERIOD,SUM(CELTCHFP.TFCONGPGSM)/(SUM(RANDOMACC.CNROCNT+RANDOMACC.RAACCFA)+0.0000001)*SUM(CLTCH.TCASSALL)/(SUM(CLTCH.TASSALL)+0.0000001) as Wireless_Accessibility FROM CELTCHFP,RANDOMACC,CLTCH WHERE CELTCHFP.EXCHID = RANDOMACC.EXCHID AND CELTCHFP.DATE = RANDOMACC.DATE AND CELTCHFP.PERIOD = RANDOMACC.PERIOD AND CELTCHFP.EXCHID = CLTCH.EXCHID AND CELTCHFP.DATE = CLTCH.DATE AND CELTCHFP.PERIOD = CLTCH.PERIOD GROUP BY CELTCHFP.EXCHID,CELTCHFP.DATE,CELTCHFP.PERIOD
有别人指出问题主要在于WHERE语句造成表关联过大,那么WHERE语句该怎么改?能不能把3个条件合为一个? |
|