What is the correct way to use .format when I want to pass other variables in the select query for MySQL?
For example I have this query that I can't figure out how to pass all the parameters together correctly
a = "c9" # this is for %s
b = "TEMP" # this is for the first {}
c = "1 hour" # this is for the last {}
c.execute("SELECT Client, {}, Date_Time from data where Client = %s and Date_Time > DATE_SUB(NOW(), INTERVAL {}".format(b,a,c)) # This doesn't work
I also tried many other variations but they didn't work as well, I am still getting the 1064
error. So, what's the correct way?!