title: postgresql: join syntax error when joining 2 select statements
body: <p>I am querying the aact database from clinicaltrials.gov. The database model is right here: <a href="https://aact.ctti-clinicaltrials.org/schema" rel="nofollow noreferrer">https://aact.ctti-clinicaltrials.org/schema</a>. I have two schemas that I am selecting from (ctgov, proj_cdek_standard_orgs).  I am trying to join two select statements. <strong>edit</strong>: I have now tried aliasing my subqueries, but that still does nothing. I get the following error:</p>
  <pre><code>(SELECT ctgov.sponsors.name, ctgov.sponsors.nct_id, ctgov.sponsors.id, ctgov.studies.phase
  FROM ctgov.sponsors, ctgov.studies
  WHERE ctgov.sponsors.nct_id=ctgov.studies.nct_id) A
  
  FULL [OUTER] JOIN
  
  
  (SELECT proj_cdek_standard_orgs.cdek_synonyms.id, proj_cdek_standard_orgs.cdek_synonyms.name
  FROM proj_cdek_standard_orgs.cdek_synonyms) B
  
  ON
  
  A.name = B.name;
  </code></pre>
  <p>I can do both select statements perfectly fine on their own, but I try the query and I get this error:</p>
  <p><code>ERROR:  syntax error at or near &quot;t1&quot; LINE 7: ) t1</code></p>
  <p>What did I do wrong and how do I use joins without getting syntax errors?</p>