问题描述
- 求高手优化sql 主要针对group by
- SELECT r.custid custid i.productid
i.officialsocialprice price
SUM(i.quanitity) amount
FROM IMEIBATCH i RDCUST r RDCUSTDETAIL d
WHERE (i.vendororgacode = 'ZD' OR
i.vendororgacode IN
(SELECT orgacode FROM organiza WHERE parentorgacode = 'ZD'))
AND i.provorgacode = d.orgcode
AND r.custid = d.custidAND i.inputdate BETWEEN TO_DATE('2013-07-15' 'YYYY-MM-DD') AND TO_DATE('2013-07-31' 'YYYY-MM-DD') + 1 GROUP BY r.custid i.productid i.officialsocialprice
加上group by custid之后 速度明显下降!求高手指点一二
时间: 2025-01-30 01:26:06