I have a python list, say l
l = [1,5,8]
I want to write a sql query to get the data for all the elements of the list, say
s
string.join the list values separated by commas, and use the format operator to form a query string.
myquery = "select name from studens where id in (%s)" % ",".join(map(str,mylist))
(Thanks, blair-conrad)