0

我正在尝试从 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 'a, wp_posts b WHERE a.ID > b.ID AND a.post_title = b.post_title' at line 1

像这样,我的查询是

DELETE FROM wp_posts a, wp_posts b WHERE a.ID > b.ID AND a.post_title = b.post_title

谁能帮我解决这个问题。

先感谢您。

4

2 回答 2

1

Delete 以不同的方式执行 Alias。

DELETE FROM a USING wp_posts a, wp_posts b 
WHERE a.ID > b.ID AND a.post_title = b.post_title

看到这里了解更多信息

于 2013-10-30T05:51:09.870 回答
0

为回答我的问题感到内疚。反正我发现了一个错误,

我的查询应该是,

DELETE a FROM  wp_posts a, wp_posts b WHERE a.ID > b.ID AND a.post_title = b.post_title;

像这样。

于 2013-10-30T05:52:13.327 回答