skip to Main Content

Mysql – Group data for SQL

https://i.stack.imgur.com/0yDsf.png year month no_of_people avg 2005 1 Overall 8 2005 2 Overall 5.0 2005 3 Overall 2.7 2005 4 Overall 4.1 2005 5 Overall 6.8 2005 6 Overall 5.2 2005 7 Overall 4.7 2005 8 Overall 4.4 2005 9 Overall…

VIEW QUESTION

Python mysql select field based on variable

I want to create a MySQL syntax to select a field based on a variable, what I have is: book_category = "science" mycursor_a.execute(("SELECT {book_categories} FROM research_papers WHERE book_Name = %s", (book,)).format(book_categories = book_category)) but I get the following error: AttributeError:…

VIEW QUESTION
Back To Top
Search