Zkuste to odstraněním e z klauzule ORDER BY, protože používáte UNION prohlášení: ORDER BY id místo ORDER BY e.id