Postgresql Count Distinct Sql Syntax Checker