Maybe something like:select team ,sum(p) as p ,sum(hw) as hw ,sum(hl) as hl ,sum(hd) as hd ,sum(aw) as aw ,sum(al) as al ,sum(ad) as ad from (select hometeam as team ,count(fthg) as p ,sum(case when fthg>ftag then 1 else 0 end) as hw ,sum(case when fthg<ftag then 1 else 0 end) as hl ,sum(case when fthg=ftag then 1 else 0 end) as hd ,0 as aw ,0 as al ,0 as ad from footballpredictor.dbo.testtable group by hometeam union all select awayteam as team ,count(ftag) as p ,0 as hw ,0 as hl ,0 as hd ,sum(case when fthg<ftag then 1 else 0 end) as aw ,sum(case when fthg>ftag then 1 else 0 end) as al ,sum(case when fthg=ftag then 1 else 0 end) as ad from footballpredictor.dbo.testtable group by awayteam ) as a group by team order by team