Reputation: 15
I am getting an error in my PostGresQL code.
org.postgresql.util.PSQLException: ERROR: syntax error at end of input Position: 250 FROM tutorial.crunchbase_companies
This usually works so I am not sure what my error means.
Upvotes: 0
Views: 3476
Reputation: 1269513
I suspect that you want the total companies, the companies with non-NULL values for a column and the ratio.
If so, this has nothing to do with distinct
:
SELECT COUNT(*),
COUNT(funding_total_usd) as num_with_funding,
AVG( (funding_total_usd IS NOT NULL)::int ) as ratio_with_funding
FROM tutorial.crunchbase_companies;
Upvotes: 1