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
  • 13,682
  • 10
  • 36
  • 61
h0ax
  • 51
  • 6

1 Answers1

-1

You need a where clause for the query to execute

SELECT id FROM table WHERE condition
Automata
  • 31
  • 4