DELETE FROM users u WHERE
(SELECT COUNT(*) FROM users u1 WHERE
u1.name = u.name AND u1.created_at > created_at) > 2
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 'u WHERE
(SELECT COUNT(*) FROM users u1 WHERE
u1.name = u.name AND u1.created_a' at line 1
`users`
и так users AS u
... Не могу понять где ошибка...