SELECT DISTINCT
subnationality,
CONVERT(varchar(3), SubDate) as months,
COUNT(CONVERT(varchar(3), SubDate))
FROM
xxx
WHERE
CONVERT(varchar(3), SubDate) IN (SELECT CONVERT(varchar(3), SubDate) AS months
FROM xxx
WHERE DATEPART(yyyy, SubDate) = 2017
GROUP BY CONVERT(varchar(3), SubDate))