I've managed to query and get results for values from a list. But say i have the genres ["Action", "Comedy", "Romance"] in the list I am using to query. My code below returns all the records which are action, romance and comedy whereas I want it to return only the records that meet all three genres. How can I do this?
The database has a field called genre in which there are multiple genres for each record.
Code:
with sqlite3.connect("animeData.db") as db: #anime database
c = db.cursor()
c.execute("select * from t where genre in %s" % repr(self.genreResults).replace('[','(').replace(']',')') ) #self.genreResults is the list containing the genres i want to query
results = c.fetchall()
print(results)
db.commit()
db.close()
Output:

Database:

It's returning all animes which have genres of action and adventure whereas I only want it to return animes which have both. Any suggestions?