title: SQL. Join with filter and offset
body: <p>I need to create a SQL query that will return images with tags. The result should be ordered by some column and filtered by UserID and tags. The result should be paginated.</p>
  <p>There is a SQL statement</p>
  <pre><code>SELECT img.*, t.Name
  FROM Image img
  INNER JOIN ImageTag it on it.ImageID = img.ImageID
  INNER JOIN Tag t on t.TagID = it.TagID
  WHERE img.UserID = 1 and t.Name in ('first','second')
  ORDER BY img.CreatedAt OFFSET 0 ROWS FETCH NEXT 50 ROWS ONLY
  </code></pre>
  <p>This request is not working as expected. I expect to get 50 images, but they will be combined with tags and the result will be something like ...</p>
  <pre>
  | Image.ImageID | Tag.Name | ... |
  | 1             | First    | ... |
  | 1             | Second   | ... |
  | 2             | First    | ... |
  | 3             | First    | ... |
  ....
  </pre>
  <p>How do I get 50 images instead of 50 rows?</p>