title: SQL2 query has self-join in it and it is getting exception '...expected: <end>'
body: <p>I want to access the node using the Self-join (strictly). The type of node is nt:unstructured and I am using the below query</p>
  
  <pre><code>SELECT same2.*, same1.firstName AS fn 
  FROM [nt:unstructured] AS same1 
  JOIN [nt:unstructured] AS same2 ON ISSAMENODE(same1, same2) 
  WHERE fn IS NOT NULL
  </code></pre>
  
  <p>But when I run my query given above, it is rejected with the exception:</p>
  
  <pre><code>javax.jcr.query.InvalidQueryException: 
  Query:SELECT same2.*, same1.firstName AS fn 
  FROM [nt:base] AS same1 
  JOIN(*)[nt:base] AS same2 ON ISSAMENODE(same1, same2) 
  WHERE fn IS NOT NULL; expected: &lt;end&gt;
  </code></pre>
  
  <p>I am not printing all the stacktrace.
  Please help me in this regard. Thanks :)</p>