title: Inserting a table name into a query gives sqlite3.OperationalError: near "?": syntax error
body: <p>I want to dynamically choose what table to use in a SQL query, but I just keep getting error however I am trying to format this. Also tried <code>%s</code> instead of <code>?</code>. </p>
  
  <p>Any suggestions? </p>
  
  <pre><code>group_food = (group, food)
  group_food_new = (group, food, 1)
  
  with con:
  
      cur = con.cursor() 
      tmp = cur.execute("SELECT COUNT(Name) FROM (?) WHERE Name=?", group_food)
  
      if tmp == 0:
          cur.execute("INSERT INTO ? VALUES(?, ?)", group_food_new)
      else: 
          times_before = cur.execute("SELECT Times FROM ? WHERE Name=?", group_food)
          group_food_update = (group, (times_before +1), food)
  
          cur.execute("UPDATE ? SET Times=? WHERE Name=?", group_food_update)
  </code></pre>