0

Code where the error appears:

def isID_inTable(id,table='question'):
   cursor.execute('SELECT id FROM %s;' , [table])

Error message:

psycopg2.errors.SyntaxError: syntax error at or near "'question'"

LINE 1: SELECT id FROM 'question';
buran
  • 11,840
  • 7
  • 28
  • 49
h0ax
  • 51
  • 5

1 Answers1

-1

You need a where clause for the query to execute

SELECT id FROM table WHERE condition
Automata
  • 31
  • 4