为什么这个sql显示mysql错误?
DELETE FROM wp_comments
JOIN wp_commentmeta ON wp_comments.comment_id =wp_commentmeta.comment_id
AND wp_commentmeta.meta_key = 'somekey'
AND wp_comments.comment_post_ID = '1'
Run Code Online (Sandbox Code Playgroud)
错误字符串
[Err] 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 'INNER JOIN wp_commentmeta ON
wp_comments.comment_id =wp_commentmeta.comment_id A' at line 2
Run Code Online (Sandbox Code Playgroud)
请告诉我.
join在delete语句中使用时,您必须指定要从哪个表中删除
DELETE c
FROM wp_comments c
JOIN wp_commentmeta m ON c.comment_id = m.comment_id
AND m.meta_key = 'somekey'
AND c.comment_post_ID = '1'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
57 次 |
| 最近记录: |