title: Get one certain entity in an JPQL
body: <p>currently I am working with JPQL to create an BookRepository.</p>
  <p>My data structure looks like this:</p>
  <ul>
  <li>One book can have multiple chapters</li>
  <li>One chapter can have multiple quotes</li>
  </ul>
  <p>Now I want to find the book, that have no quotes in the last 10% of the pages. My problem is that my program always compares ALL quotes, but I only need the last one to compare.</p>
  <p>This is my JPQL:</p>
  <p>@Query(&quot;SELECT DISTINCT b FROM Book b, Chapter c, Quote q JOIN b.chapters c JOIN c.quotes q WHERE q.pageNumber &lt; (b.pageNumber * 0.9) AND q ORDER BY b.title&quot;)</p>
  <p>Thank you for your help!</p>