尝试删除时 MySql 出错
Error in MySql when trying to delete
我正在尝试删除 comments_approved table 中标记为 'spam' 的 wordpress 站点中的评论。尽管我看不出 SQL 语句有任何问题,但我一直收到错误消息。错误是:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete FROM <code>mysitealias_comments
WHERE comment_approved` = 'spam'' at line 1
我正在使用解释,因为我只是想在 运行 之前进行测试。为什么我会收到此错误的任何想法?
EXPLAIN delete
FROM `mysitealias_comments`
WHERE comment_approved` = 'spam';
如果我将 delete
更改为 select *
就可以了,所以我想知道这一定与 Delete
?
有关
抱歉,如果人们认为我的编码问题 "off topic",我现在会在其他地方提问!
在comment_approved
前打勾
您的查询中多了一个勾号。试试这个:
EXPLAIN DELETE
FROM mysitealias_comments
WHERE comment_approved = 'spam';
我正在尝试删除 comments_approved table 中标记为 'spam' 的 wordpress 站点中的评论。尽管我看不出 SQL 语句有任何问题,但我一直收到错误消息。错误是:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
'delete FROM <code>mysitealias_comments
WHERE comment_approved` = 'spam'' at line 1
我正在使用解释,因为我只是想在 运行 之前进行测试。为什么我会收到此错误的任何想法?
EXPLAIN delete
FROM `mysitealias_comments`
WHERE comment_approved` = 'spam';
如果我将 delete
更改为 select *
就可以了,所以我想知道这一定与 Delete
?
抱歉,如果人们认为我的编码问题 "off topic",我现在会在其他地方提问!
在comment_approved
您的查询中多了一个勾号。试试这个:
EXPLAIN DELETE
FROM mysitealias_comments
WHERE comment_approved = 'spam';