title: Syntax error near "AS"
body: <p>I am trying to execute the below statement, and I'm getting an error stating </p>
  
  <blockquote>
    <p>ERROR:  syntax error at or near "AS"</p>
  </blockquote>
  
  <p>Below is my SQL statement </p>
  
  <pre><code>CREATE TEMPORARY TABLE IF NOT EXISTS temp_users 
  AS 
  (SELECT patient.patientid as patient 
   FROM patients 
   WHERE patient.name = "Ann");
  </code></pre>
  
  <p>My Postgres version is 9.5.6. I tried many ways but failed. Does anyone know the fix for this? </p>