Sum and Average with union queries