From here:
l=[1,2,3,4] placeholder= '?' # Works For SQLite. placeholders= ', '.join(placeholder for dummy in l) #puts in len(l) '?' marks, separated by ', ' query= 'SELECT name FROM students WHERE id IN (%s)' % placeholders cursor.execute(query, l)
Comments
Post a Comment