MySQL group-by very slow

后端 未结 5 2144
予麋鹿
予麋鹿 2021-02-07 05:34

I have the folowwing SQL query

SELECT CustomerID FROM sales WHERE `Date` <= \'2012-01-01\' GROUP BY CustomerID

The query is executed over 11

5条回答
  •  灰色年华
    2021-02-07 06:11

    try this one :

    SELECT distinct CustomerID FROM sales WHERE `Date` <= '2012-01-01'
    

提交回复
热议问题