i’m trying to use an IN statement to return results which match one of a list of strings
for example
strings = ['string1', 'string2', 'string3']
c.execute('select count(*) from table where foo in ?', strings)
i know this is incorrect and doesnt work but i hope that it highlights what im trying to do…
You can’t do that. There are three problems:
tableunless you use backticks around the table name.Try this instead:
If the number of strings is variable, use this instead: