change select like this and trySELECT RateCount.RateCount,RateCount.ZoneId,RateCount.Zone,RateCount.PriceModifier,CountryCount.CountryCountFROM(SELECTCOUNT(R.ZoneId) AS RateCount,Z.ZoneId,Z.Zone,Z.PriceModifierFROM ShippingZones ZLEFT JOIN ShippingRates R ON R.ZoneId = Z.ZoneId WHERE ShippingServiceId = @ShippingServiceIdGROUP BY Z.ZoneId,Z.Zone,Z.PriceModifier)RateCountINNER JOIN ( SELECT S.ZoneId ,COUNT(S.ZoneId) AS CountryCountFROM ShippingZones ZLEFT JOIN ShippingCountryToZone S ON S.ZoneId = Z.ZoneId)CountryCountON CountryCount.ZoneId =RateCount.ZoneId