Jess McKenzie Jess McKenzie - 4 years ago 109
SQL Question

MYSQL Syntax incorrect

I have the following statement below that is getting an error of

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 'c
JOIN campaignsFroms f ON f.id = c.id
JOIN campaignsRaw r ON r.' at line 2


What syntax am I missing?

Code:

DELETE
FROM campaigns c
JOIN campaignsFroms f ON f.id = c.id
JOIN campaignsRaw r ON r.id = c.id
JOIN campaignsSubjects s ON s.id = c.id
JOIN campaignIPTracking ip ON ip.id = c.id
JOIN campaignTracking ct ON ct.id = c.id
WHERE c.id = '1582'

Answer Source
 DELETE c
FROM campaigns c
JOIN campaignsFroms f      ON f.id = c.id
JOIN campaignsRaw r        ON r.id = c.id
JOIN campaignsSubjects s   ON s.id = c.id
JOIN campaignIPTracking ip ON ip.id = c.id
JOIN campaignTracking ct   ON ct.id = c.id
WHERE c.id = '1582'                                 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download