Syntax Error at End of Input in Postgresql

Syntax error at end of input in PostgreSQL

You haven't provided any details about the language/environment, but I'll try a wild guess anyway:

MySQL's prepared statements natively use ? as the parameter placeholder, but PostgreSQL uses $1, $2 etc. Try replacing the ? with $1 and see if it works:

WHERE address = $1

The error messages in PostgreSQL are very cryptic.

In general, I've found that Postgres error messages are better than competing products (ahem, MySQL and especially Oracle), but in this instance you've managed to confuse the parser beyond sanity. :)

Postgres showing Error: syntax error at end of input

You must close the parentheses when creating the table

# create table in ebi_mut_db schema
cursor.execute("""
CREATE TABLE IF NOT EXISTS ebi_mut_db.version_info(
version INT,
download_date DATE,
download_url text,
responsible text)
""")

PostgresQL Syntax Error at end of input, how do I troubleshoot this?

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;


Related Topics



Leave a reply



Submit