I have a Python dictionary that has list of all products we sell. Is is possible to have these products entered in a WHERE clause of a SQL statement as shown below and get the corresponding output.
Dictionary
Given below is the list of products we sell:
prod_list : [prod_a, prod_b, prod_c, prod_d]
I am looking to have a separate SQL generated for each of these products wherein the above mentioned prod_names would be used in the where clause in the SQL listed below:
Sample SQL:
select prod_id,prod_name,count (*)
from daily_sales
where prod_name = '' <-- this value to be pulled from the dictionary above
group by prod_id,prod_name
I am using Amazon Redshift DB..
Could anyone guide me on how to do this. Thanks.