There is a table with relatively large data, and you need to DELETE the association. When you DELETE the table, you will find the following SQL error: DELETE FROM test. test1 a where exists (SELECT 1 FROM test. test2 B WHERE. recordID = B. smsInfoID AND B. receiveTime <= "00:00:00") limit 1000;
Error Code: 1064You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'a where exists (SELECT 1 FROM test. test2 B WHERE. recordID = B. smsInf 'at line 1 www.2cto.com thought it was an exists problem, so it was changed to in and then tested, and the same error was reported: delete from test. test1 a WHERE. recordid IN (SELECT B. smsInfoID FROM test. test2 B WHERE B. receiveTime <= "2011-10-09 00:00:00 ") LIMIT 1000; the original MYSQL delete statement does not support aliases! Remove the alias and change the SQL statements reported in the preceding two statements to the following format: DELETE FROM test. test1 WHERE recordid IN (SELECT smsInfoID FROM test. test2 WHERE receiveTime <= "2011-10-09 00:00:00") LIMIT 1000; www.2cto.com delete from test. test1 where exists (SELECT 1 FROM test. test2 WHERE test1.recordID = test2.smsInfoID AND test2.receiveTime <= "00:00:00") LIMIT 1000; no trace of the author Feihong