title: Typeorm relations query builder
body: <p>I have a little problem figuring out how to get data from a linked table using queryBuilder</p>
  <p><strong>Currently i have this code</strong>:</p>
  <pre class="lang-js prettyprint-override"><code>const users = await databaseConntection
        .getRepository(User)
        .createQueryBuilder(&quot;user&quot;)
        .select([&quot;images.author_id&quot;, &quot;user.id&quot;, &quot;user.username&quot;])
        .leftJoinAndSelect(
          (queryBuilder) =&gt;
            queryBuilder
              .select([&quot;title&quot;, &quot;updated_at&quot;, &quot;author_id&quot;])
              .from(Image, &quot;image&quot;)
              .orderBy({ updated_at: &quot;ASC&quot; })
              .take(5),
          &quot;images&quot;,
          &quot;images.author_id = user.id&quot;
        )
        .andWhere(&quot;username LIKE :profile&quot;)
        .setParameters({
          profile: `%${profile}%`,
        })
        .groupBy(&quot;images.author_id&quot;)
        .take(limit)
        .skip(page * limit - limit)
        .getRawMany();
  </code></pre>
  <p><strong>Current result</strong>:</p>
  <pre><code>column &quot;user.id&quot; must appear in the GROUP BY clause or be used in an aggregate function
  </code></pre>
  <p><strong>Expected result</strong>:</p>
  <pre class="lang-json prettyprint-override"><code>[
     {
       &quot;id&quot;: 1,
       &quot;username&quot;: &quot;some username&quot;,
       &quot;images&quot;: [
          {
             &quot;title&quot;: &quot;some image title&quot;,
             &quot;updated_at&quot;: &quot;2021-05-21T03:49:44.299Z&quot;,
             &quot;author_id&quot;: 1
          }
          ...rest 4 images
       ]
     }
     ...rest users
  ]
  </code></pre>
  <p>How i can achieve this result using query builder?</p>
  <p>Thanks for any helping.</p>