Postgresql Count Distinct Not Null In Sql