title: Why does my SQL query give error 1146 looking for Database.Database?
body: <p>Why does the following statement return an 1146 error with SQL Table "HistoryDB.HistoryDB" does not exist? I am attempting to join two tables within the same database where their ids match. I apologize if the column/table names are confusing they have been mangled for security purposes.</p>
  
  <pre><code>select Reporttbl.id, TableInfo_tbl.lastTime
      from HistoryDB
      INNER JOIN Reporttbl AS TableInfo_tbl on Reporttbl.statID = TableInfo_tbl.statID
      WHERE lastReportTime BETWEEN '2016-09-13 00:00:00' and '2016-09-13 23:00:00'
      Group BY id, UNIX_TIMESTAMP(lastReportTime) DIV 3600 ORDER BY id ASC
  </code></pre>