title: oracle db "invalid table name" but works with sqllite
body: <p>I have two databases, one is in a test environment and is sqllite3 and the other is an oracle db for qa/prod.  It's not my system and I am not in control of this set-up.  I wrote an SQL query that works in my test environment but failed against qa.  I'm assuming it has something to do with discrepancies between oracle and sqllite3 but I can't figure out what's going on.  thanks for the help.</p>
  
  <p>here's the error and the SQL:</p>
  
  <p><strong>OCIError: ORA-00903: invalid table name:</strong> </p>
  
  <pre><code>SELECT 'agency' AS came_from,
  account.name as account_name, agency.id as id,
  agency.name as name,
  agency.contact_name as contact_name, 
  agency.contact_email as
  contact_email, agency.phone_number as phone_number,
  agency.account as account
  FROM 'agency' LEFT OUTER JOIN account 
  ON account.id ='agency'.account WHERE account in (1601)   
  UNION SELECT 'advertiser' AS  came_from, 
  account.name as account_name, advertiser.id as id,
  advertiser.name as name, advertiser.contact_name as contact_name,
  advertiser.contact_email as contact_email, 
  advertiser.phone_number as phone_number,
  advertiser.account as account 
  FROM 'advertiser' 
  LEFT OUTER JOIN account ON account.id = 'advertiser'.account 
  WHERE account in (1601) AND (advertiser.workflow_state &lt;&gt; 'deleted'
  OR advertiser.workflow_state
  IS NULL)  ORDER BY name asc
  </code></pre>