I have the following query:
DELETE proxies, pxpl FROM proxies JOIN proxy_xref_proxy_list AS pxpl ON proxies.ID=pxpl.ProxyID WHERE pxpl.DeactivationTS < (NOW() - INTERVAL 24 HOUR) ORDER BY pxpl.ProxyListID, proxies.ID
The ordering is needed to avoid DB deadlocks. However, it yields an error:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ORDER BY pxpl.ProxyListID, proxies.ID' at line 4
proxy_xref_proxy_list is a many-to-many relation association table.