0

SQL DELETE 在 PHPmyAdmin 中失败。不知道为什么;是因为 LEFT OUTER JOIN 吗?

SELECT * 
  FROM `User` 
LEFT OUTER JOIN `freshersdata` ON `User`.`username`=`freshersdata`.`username` 
 WHERE (`freshersdata`.`username` IS null) 
   AND (`User`.`Persistent`!=1)

此 SQL 查询因 (#1064 - You have an error in your SQL syntax;) 消息而失败,但使用 SELECT 而不是 delete 时效果很好,这是为什么呢?

4

2 回答 2

0

您必须指定要从哪个表中删除:

例如来自用户:

DELETE User.* 
  FROM User 
LEFT OUTER JOIN freshersdata ON User.username=freshersdata.username 
 WHERE (freshersdata.username IS null) AND (User.Persistent!=1)
于 2009-10-03T21:56:14.503 回答
0
DELETE FROM User 
LEFT OUTER JOIN 
   freshersdata ON User.username=freshersdata.username  
WHERE (freshersdata.username IS null) AND (User.Persistent!=1)
于 2009-10-03T22:10:20.237 回答