So, I'm trying to assign some SQL to a variable which will later be executed in the code. I also want to include a varible inside the SQL. I am only allowed to code over 80 characters and then I have been told to use a black slash, now this causes a problem. Hopefully this better explains it:
sql_query = """"SELECT A1.value Value, COUNT(A1.value) "Frequency", A1.category Category' FROM popularity A1 WHERE Category = "books" GROUP BY A1.value"""
I need to insert a varible here:
WHERE Category = category
Now that I think about it I might just assign each line to a variable but it's not aesthetically pleasing.