my table in a database is as follow
Username city Type
Anna Paris abc
Marc london abc
erica rome AF
Sara Newyork cbd
silvia paris AD
I have a list contains string values
typelist = {'abc', 'cbd'}
and i want to query my database using sqlalchemy , to get data from a table where a column type equals the values in the list :
Username city Type
Anna Paris abc
Marc london abc
Sara Newyork cbd
im trying this code
sql = "SELECT * FROM table WHERE data IN :values"
query = sqlalchemy.text(sql).bindparams(values=tuple(typelist))
conn.engine.execute(query)
but it return just one value from the typelist not all the list values .
Username city Type
Sara Newyork cbd