Passing a list of parameters as input to a SQL query
I have a SQL query that I want to execute on a list of input parameters.
SELECT Field1, Field2
FROM Table
WHERE Field3 = ?
AND Field4 = ?
I have ~ 10,000 pairs of values for which I want to run this query. For now, I am iterating over the list and adding each result to a dataframe. I feel like there is probably a more pythonic way to do this. I just don't know what it is.
Is there a cleaner way to do this?
+3
source to share