Если я вас правильно понимаю, тогда это довольно простой расчет, если у вас фиксированное количество гонок.
Этот запрос вернет то, что вы ищете:
declare @RACES TABLE (RACE varchar(16))
insert into @RACES (RACE) values ('AS'), ('BA'), ('HP'), ('IN'), ('UN'), ('WH')
select RACE,
(select count(*)
from MYTABLE
where RACE in (Race1, Race2, Race3, Race4, Race5) and
'AS' in (Race1, Race2, Race3, Race4, Race5)) as 'AS',
(select count(*)
from MYTABLE
where RACE in (Race1, Race2, Race3, Race4, Race5) and
'BA' in (Race1, Race2, Race3, Race4, Race5)) as 'BA',
(select count(*)
from MYTABLE
where RACE in (Race1, Race2, Race3, Race4, Race5) and
'HP' in (Race1, Race2, Race3, Race4, Race5)) as 'HP',
(select count(*)
from MYTABLE
where RACE in (Race1, Race2, Race3, Race4, Race5) and
'IN' in (Race1, Race2, Race3, Race4, Race5)) as 'IN',
(select count(*)
from MYTABLE
where RACE in (Race1, Race2, Race3, Race4, Race5) and
'UN' in (Race1, Race2, Race3, Race4, Race5)) as 'UN',
(select count(*)
from MYTABLE
where RACE in (Race1, Race2, Race3, Race4, Race5) and
'WH' in (Race1, Race2, Race3, Race4, Race5)) as 'WH'
from @RACES
Хотя, если у вас переменное количество гонок, вам нужно будет динамически построить этот оператор SQL и запустить его с помощью sp_executesql
https://www.mssqltips.com/sqlservertip/1160/execute-dynamic-sql-commands-in-sql-server/