select count(distinct GK.localId) from GoogleKeyword GK left outer JOIN GoogleKeywordReport GKR ON GK.backId = GKR.backKeywordId AND GKR.reportDate BETWEEN #{startDay} AND #{endDay} right outer JOIN GoogleAdGroup GA ON GK.localAdGroupId = GA.localId right outer JOIN GoogleCampaign GC ON GK.localCampaignId = GC.localId where GK.accountId = #{accountId}