0

I am referring to question

what if I have to pass some extra parameter along with list in the query. Suppose I want to pass the location as well

`placeholder= '?' # For SQLite. See DBAPI paramstyle.
 placeholders= ', '.join(placeholder for unused in l)
 query= 'SELECT name FROM students WHERE id IN (%s) and location= %(location)s' % placeholders
 cursor.execute(query, {'location' : 'canada', 'desired_list' : list_of_ids })

how to convert list into tuple for using in sql query? Thanks

Rahul Reddy
  • 110
  • 11

0 Answers0