I would be very grateful for a bit of assistance with optimising a query. The code is as follows:
CREATE TABLE table_name (
The query runs but times out even though column1 and column2 are both index columns.Code:SELECT T1.* FROM table1 AS T1, (SELECT column1, column2, COUNT(column1) AS cnt FROM table1 GROUP BY column1 HAVING cnt>1 ) AS T2 WHERE T1.column1 = T2.column1 AND T1.column2 = T2.column2 ORDER BY T1.column1
Any suggestions would be most helpful.
Thanks in advance.