I have a list of string as follow:
['a', 'b', 'c']
and I need to create a SQL query from it. I am writing this kind of query because I am using the python client for BigQuery and this is the way to do. The query will look like this:
WHERE data IN ('a', 'b', 'c')
I tried to do this:
WHERE data IN ({", ".join(myList)})
but the result is:
WHERE data IN (a, b, c)
How should I do this?
EDIT FOR PRECISION
Actually my problem was that I was already in a f string and couldn't use a backslash into it to escape my quotes. I did like so:
quote = "'"
f'WHERE gcloud_id IN ({", ".join(f"{quote}{ g_id }{quote}" for g_id in gcloud_id)}) '
Thanks