title: Improper identifier with SQL compilation error in Snowflake
body: <p>I am trying join two table in SQL using the following code:</p>
  <pre><code>SELECT 
    lo.PATIENT_ID AS pid,
    lo.SERVICE_CODE,
    de.PATIENT_ID as pid,
    de.STATE,
    de.GENDER,
    de.ETHNICITY
  FROM
    &quot;DB&quot;.&quot;SCHEMA&quot;.&quot;TABLE&quot; AS lo
  INNER JOIN
    &quot;DB&quot;.&quot;SCHEMA&quot;.&quot;TABLE&quot; AS de
  ON
    lo.pid = de.pid
  WHERE 
    lo.SERVICE_CODE = `2345.7';
  </code></pre>
  <p>I am getting an error stating &quot;SQL compilation error: invalid identifier 'LO.PID'. Line 13 is referring to the ON statement &quot;lo.pid = de.pid&quot; The data types are the same. Is there a glaring issue in the code. I've tried changing the alias on both the tables and variables but that didn't seem to work.</p>