Sql Count Over Partition By Where Clause In Postgresql