title: SQL syntax error near "WHERE" 2
body: <p>Query:</p>
  
  <pre><code>select distinct R1.name, R2.name
  from (
      (
      select Ra.mID mID, Re.rID rID, Re.name name
      from Rating Ra join Reviewer Re using (rID)
      ) R1
      ,
      (
      select Ra.mID mID, Re.rID rID, Re.name name
      from Rating Ra join Reviewer Re using (rID)
      ) R2
  where R1.mID = R2.mID and R1.rID &gt; R2.rID;
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>Query failed to execute: near "where": syntax error
  </code></pre>
  
  <p>I am guessing the problem has something to do with the pointer variables in the FROM clause that are referred to in the WHERE clause, but I can't figure it out. I haven't been very wary of my WHEREs recently...</p>