title: Unable to convert SQL to JPQL
body: <p>I am trying to convert following Oracle SQL (which works)</p>
  
  <pre><code>select sum(ct.some_count) from TABLE1 mc
    inner join TABLE2 xref on mc.cnum = xref.cnum
    inner join TABLE3 ct on xref.srt = ct.srt
    inner join TABLE4 pc on pc.id = xref.id
    where mc.CARD_NO = '111' and pc.code = '222';
  </code></pre>
  
  <p>To following JPQL. </p>
  
  <pre><code>@Query("SELECT sum(ct.someCount) FROM Table1Entity mc " +
          "inner join TABLE2Entity xref on mc.cnum = xref.cnum " +
          "inner join TABLE3Entity ct on xref.srt = ct.srt " +
          "inner join TABLE4Entity pc on pc.id = xref.id " +
          "where mc.CARD_NO = :cardNumber and pc.code = :code")
  long getTotalCount(@Param("cardNumber") String cardNumber, @Param("code") String code);
  </code></pre>
  
  <p>I am getting the following Exception. </p>
  
  <blockquote>
    <p>QuerySyntaxException: unexpected token</p>
  </blockquote>
  
  <p>Can I please get some help on what I am doing wrong? </p>
  
  <p>I am using Spring and this is my Repository for this Query. </p>
  
  <pre><code>@Repository(value = "someCountRepository")
  public interface SomeCountRepository extends JpaRepository&lt;Table3Entity, TableId&gt; {
          @Query("SELECT sum(ct.someCount) FROM Table1Entity mc " +
          "inner join TABLE2Entity xref on mc.cnum = xref.cnum " +
          "inner join TABLE3Entity ct on xref.srt = ct.srt " +
          "inner join TABLE4Entity pc on pc.id = xref.id " +
          "where mc.CARD_NO = :cardNumber and pc.code = :code")
          long getTotalCount(@Param("cardNumber") String cardNumber, @Param("code") String code);
  }
  </code></pre>