Trying to change this SELECT statement
SELECT t1.user_id FROM jforum_users t1 WHERE EXISTS
(SELECT t3.user_id
FROM jforum_users t3
LEFT JOIN jforum_posts t2 ON t3.user_id=t2.user_id
WHERE user_website IS NOT NULL
AND t2.user_id IS null
AND t1.user_id=t3.user_id
);
into a DELETE statement
DELETE FROM jforum_users t1 WHERE EXISTS
(SELECT t3.user_id
FROM jforum_users t3
LEFT JOIN jforum_posts t2 ON t3.user_id=t2.user_id
WHERE user_website IS NOT NULL
AND t2.user_id IS NULL
AND t1.user_id=t3.user_id
);
The SELECT statement works but DELETE but doesnt like it giving error:
ERROR 1064 (42000): 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 'where exists (select t3.user_id from jforum_users t3 left join jforum_posts t2 o' at line 1
what am i doing wrong ?