advancedfuture Posted November 6, 2008 Share Posted November 6, 2008 I am trying to run a query on my database to delete all entries that have duplicate cities and only leave on city. But I keep getting an error: My query: DELETE FROM zip_code WHERE COUNT( city ) >1 GROUP BY city The error I keep getting: #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 'GROUP BY city' at line 1 What is wrong with my query? Any help would be much appreciated Link to comment https://forums.phpfreaks.com/topic/131588-error-1064-with-query/ Share on other sites More sharing options...
fenway Posted November 6, 2008 Share Posted November 6, 2008 Would be easier just to add a unique index for 1 second. Link to comment https://forums.phpfreaks.com/topic/131588-error-1064-with-query/#findComment-683715 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.