3

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 WHERE EXISTS (SELECT 1 from 80dage_garmin_track` t2 WHERE t1.Le' at line 1

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

+1 for... drop the table alias (t1), which is also not allowed for DELETE
I did a SELECT of the query and seleced all rows in phpmyadmin and deleted them. Worked out well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.