title: Translating a complicated SQL query to python 2 for SQLite3
body: <p>Below I have some code that connects to database and runs a query. This query runs as expected if I punch it into DB Browser for SQLite, but when I run it in python, I receive the error :</p>
  
  <p><strong>sqlite3.OperationalError: no such column: CHARACTER_INNATES.PC_ID</strong></p>
  
  <p>I have read some documentation and multiple StackOverflow comments about parameters, and their purpose to prevent problems like injection attacks. I tried that approach, which littered '?' everywhere, making it unreadable and unmaintainable, and it didn't work. It returned an empty tuple. This leads me to believe there should be an easier way of performing these kinds of SQL queries. So is there? Or am I missing something obvious?</p>
  
  <pre><code>db = sqlite3.connect('TheGame.db')
  db.text_factory = str
  conn = db.cursor()
  query = 'SELECT CHARACTERS.Full_Name, CHARACTER_INNATES.PC_ID, SKILLS_INNATES.Skill, Sum([CHARACTER_INNATES].[Current]*[Weight]) AS [Current Innate], Sum([CHARACTER_INNATES].[Maximum]*[Weight]) AS [Max Innate]\
        FROM CHARACTERS INNER JOIN (SKILLS_INNATES INNER JOIN CHARACTER_INNATES ON SKILLS_INNATES.Innate = CHARACTER_INNATES.Innate) ON CHARACTERS.ID = CHARACTER_INNATES.PC_ID\
        GROUP BY CHARACTERS.Full_Name, CHARACTER_INNATES.PC_ID, SKILLS_INNATES.Skill\
        ORDER BY CHARACTER_INNATES.PC_ID, Sum([CHARACTER_INNATES].[Current]*[Weight]) DESC;'
  conn.execute(query)
  print conn.fetchall()
  </code></pre>
  
  <p>My attempt at a fix looked something like</p>
  
  <pre><code>params = ('CHARACTERS.Full_Name', 'CHARACTER_INNATES.PC_ID', ...) #this continued for awhile
  query = 'SELECT ?, ?, ?, ...'
  conn.execute(query, params)
  print conn.fetchall() # prints empty tuple
  </code></pre>