我已经搜索了答案,但找不到我做错了什么,我一直收到错误;
DELETE
FROM kp_postmeta
JOIN kp_posts
ON kp_postmeta.post_id = kp_posts.ID
WHERE (kp_posts.post_type = 'flamingo_inbound' AND kp_posts.post_date < '2014-12-31')
有人能告诉我我做错了吗?
答案 0 :(得分:0)
您需要在delete
之后指定要删除的表格。如果两者都是这样的话
DELETE kp_postmeta, kp_posts
FROM kp_postmeta
JOIN kp_posts ON kp_postmeta.post_id = kp_posts.ID
WHERE kp_posts.post_type = 'flamingo_inbound'
AND kp_posts.post_date < '2014-12-31'