I have a problem where SQL query runs without error in database(using Db browser), but when I run it in my python program it gives me an error. The following is the query:
c.execute("SELECT Date, Details, SUM((Debit) - (Credit)) OVER (ORDER by Date ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS balance FROM maindata WHERE Details =?' ORDER BY Date", pg)
It gives me this error-:
sqlite3.OperationalError: near "(": syntax error
WHERE Details =?'This symbol'after the?looks strange'charactet from SQL, Also check whetherpgparameter is a tuple or a list, if none of them (but for example a number or a string), then usec.execute(".....", (pg,) )