开发者

MySQL Error? Where the syntax mistake?

开发者 https://www.devze.com 2023-01-19 23:36 出处:网络
Tried thus query with \"SELECT *\" instead of \"DELETE FROM\" and it worked perfectly. DELETE FROM`80dage_garmin_track` t1 WHERE EXISTS (

Tried thus query with "SELECT *" instead of "DELETE FROM" and it worked perfectly.

DELETE FROM  `80dage_garmin_track` t1 WHERE EXISTS (

SELECT 1 
FROM  `80dage_garmin_track` t2
WHERE t1.Length = t2.Length
AND t1.Time = t2.Time
AND t1.idgarmin_track > t2.idgarmin_track
)

MySQL Error: .#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 't1 WH开发者_如何学PythonERE EXISTS (SELECT 1 from 80dage_garmin_track` t2 WHERE t1.Le' at line 1


MySQL does not allow all kinds of sub selects in the WHERE clause of DELETE, see this thread. Yours may (or may not) be fine, if you drop the table alias (t1), which is also not allowed for DELETE.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号