----- Original Message -----
> From: "Machiel Richards" <machiel.richards@stripped>
> 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 'GROUP BY t.AccountID,
I suspect your query has never been doing what you think at all, and you need to
select [fields] from (
select fields1 blahblah
select fields2 blahblah) unionized
group by blurb
that is, wrap the entire union in a virtual table and do the group by on that.
Unhappiness is discouraged and will be corrected with kitten pictures.