Postgres Select Count From Sql Statement