MYSQLdelete statement does not support alias _ MySQL
Source: Internet
Author: User
The MYSQLdelete statement does not support alias problems bitsCN.com
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 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 <= "00:00:00") LI MIT 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; delete from test. test1 where exists (SELECT 1 FROM test. test2 WHERE test1.recordID = test2.smsInfoID AND test2.receiveTime <= "2011-10-09 00:00:00") LIMIT 1000; author: Feihong no trace bitsCN.com
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service