title: Nhibernate Named SQL Query
body: <p>Can any body tell me what is wrong with below query Named SQL Query using <em>NHibernate</em>.
  As I am getting error - "Error in Named Query : GetSecondReviewIncomeStatements ":</p>
  
  <pre><code> &lt;sql-query name="GetSecondReviewIncomeStatements" read-only="true"&gt;
   &lt;![CDATA[
    SELECT I.TotalNetSales,I.CostOfGoodsSold,I.GrossProfit
    FROM IncomeStatement as incomeStatement
    INNER JOIN FETCH CompSearchResultItem as resultItem
    ON incomeStatement.Comparable.ID = resultItem.Comparable.ID
    AND resultItem.CompSearch.ID = :compSearchID     
    ]]&gt;--&gt;
   &lt;/sql-query&gt;--&gt;
  </code></pre>
  
  <p>I have searched a lot on the web, some say instead on <code>On</code> put <code>Where</code>.
  I also tried <code>NamedQuery</code> only but everytime I get the same error.</p>