creo que tu error va de que no se pueden ordernar los datos de los queries que forman parte de una sentencia union, prueba con esto:
Código MySQL:
Ver originalINSERT INTO email_queues
(queueid
, queuetype
, ownerid
, recipient
, processed
)
FROM email_list_subscribers
AS subscribers
JOIN email_lists
AS lists
ON lists.listid
= subscribers.listid
AND lists.listid
IN (1) (
subscribers.subscriberid
IN ( FROM email_subscribers_data d
)
)
)
AND (subscribers.unsubscribed
=0 AND subscribers.bounced
=0)
FROM email_list_subscribers
AS subscribers
JOIN email_lists
AS lists
ON lists.listid
= subscribers.listid
AND lists.listid
IN (1) (
subscribers.subscriberid
IN ( FROM email_subscribers_data d
)
)
)
AND (subscribers.unsubscribed
=0 AND subscribers.bounced
=0)