Sql Count Over Partition By Where Clause Is Ambiguous