Fields are not aligned properly for union query with group by list. The select list should contain aggregate fields first ...