使用限制删除SQL查询

时间:2013-02-12 18:13:42

标签: mysql sql

我有这个查询

DELETE c FROM review_comments AS c 
LEFT JOIN users AS u 
ON u.user_id = c.user_id
WHERE c.comment = '{$comment}'
AND u.username = '{$user}'
LIMIT 1;

在我删除LIMIT 1;

之前,它无效

它说: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 'LIMIT 1' at line 6

在这种情况下,这是LIMIT 1的错误用法吗?我有一个相同的查询没有连接表,LIMIT 1工作得很好?

1 个答案:

答案 0 :(得分:4)

我认为LIMIT不能用于MySQL中的多表引用DELETE语句。