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
This Will Work If Number of Values in List equals to 1 or greater than 1
t = str(tuple(l)) if t[-2] == ',': t= t.replace(t[-2],"") query = "select name from studens where id IN {}".format(t)