Skip to content
Advertisement

mysql-connector-python query with WHERE IN

I am trying to query a table with WHERE IN condition using mysql-connector-python like this:

JavaScript

And I get the following error:

JavaScript

How can I get it working?

Advertisement

Answer

You should add “” in ids to be a String and also ‘,’ should be replaced with ‘%’

E.g.

JavaScript
Advertisement