I have a bunch of column names in a Python list. Now I need to use that list as the column names in a SELECT
statement. How can I do that?
pythonlist = ['one', 'two', 'three']
SELECT pythonlist FROM data;
So far I have:
sql = '''SELECT %s FROM data WHERE name = %s INTO OUTFILE filename'''
cur.execute(sql,(pythonlist,name))