Postgresql Count Group By Sql Statement Syntax