如何结合"删除"和"删除查询"

时间:2014-03-29 00:36:16

标签: mysql database join combinations sql-delete

我有2个查询 - DELETE FROM和DELETE A FROM我正在尝试将它们组合成一个查询,我尝试了几种方法,但我仍然遇到语法错误:

  1. DELETE A FROM wp_posts AS a INNER JOIN ( SELECT post_content, MIN( id
    ) AS min_id FROM wp_posts WHERE post_type = 'post' AND post_status =
    'publish' GROUP BY post_content HAVING COUNT( * ) > 1 ) AS b ON
    b.post_content = a.post_content AND b.min_id <> a.id AND a.post_type =
    'post' AND a.post_status = 'publish'
    
  2. DELETE FROM wp_posts WHERE `post_title` like '%.png%'
    

0 个答案:

没有答案