Published
- 1 min read
python concat list to sql query string
The solution for this is noted below
python concat list to sql query string
Solution
l = [1, 5, 8]
sql_query = 'select name from studens where id in (' + ','.join(map(str, l)) + ')'
Try other methods by searching on the site. That is if this doesn’t work