0
DELETE FROM `client_task`
INNER JOIN `project_task` 
        ON client_task.taskid=project_task.taskid
     WHERE projectid = '2' 

I think you can see what i want to do, but i get following 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 'INNER JOIN project_task ON client_task.taskid=project_task.taskid ' at line 2

Cant figure out what´s the matter. It´s MySql.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user3718058
  • 303
  • 1
  • 3
  • 11
  • 2
    Which table are you trying to delete rows from? `client_task`, or both tables? MySQL's syntax requires you to specify it like `DELETE client_task.* FROM client_task INNER JOIN...` http://dev.mysql.com/doc/refman/5.0/en/delete.html – Michael Berkowski Jul 05 '14 at 21:16
  • thanks, solved the problem. – user3718058 Jul 05 '14 at 21:25
  • possible duplicate of [SQL DELETE with INNER JOIN](http://stackoverflow.com/questions/8598791/sql-delete-with-inner-join) – Jens Jul 05 '14 at 21:30

0 Answers0