-1

假设我有这样的 SQL

select  distinct CUSTOMER_PRODUCT_ORDER as ORDER
from MASTER_LIST 
where PROJECT_ID     = "ABCDD"
 order by   ORDER ASC

如何优化运行此 sql 的性能?

4

1 回答 1

-1

我认为在大多数情况下,使用 group by 会更好,性能更高:

select  CUSTOMER_PRODUCT_ORDER as ORDER
from MASTER_LIST 
where PROJECT_ID     = "ABCDD"
GROUP BY CUSTOMER_PRODUCT_ORDER
 order by   ORDER ASC
于 2012-09-21T09:44:16.970 回答