Syntax error at end of input in PostgreSQL

后端 未结 4 2025
南旧
南旧 2020-11-29 11:35

I have used the next SQL statement in both MySQL and PostgreSQL, but it fails in PostgreSQL

db.Query(`SELECT COUNT(*) as N FROM email WHERE address = ?`, ema         


        
4条回答
  •  有刺的猬
    2020-11-29 11:56

    In my case, it was due to using a -- line comment where the program that was responsible for interacting with the database read in the multiple lines of my query all as one giant line. This meant that the line comment corrupted the remainder of the query. The fix was to use a /* block comment */ instead.

提交回复
热议问题