title: Sequelize - Adding a limit to a query with an include, fails to properly limit retrievals
body: <h2>Issue Description</h2>
  
  <p>Adding a limit to a Sequelize Query with a SubQuery fails to limit retrievals. Multiple online resources referencing this error and no solutions. Is this a Sequelize error or user error?</p>
  
  <h3>What are you doing?</h3>
  
  <pre><code>ThreadFolderUser.findAll({
  order: [
    ['updated_at', 'DESC']
  ],
  where: {
    user_id,
    folder_id,
    deleted,
    archived,
  },
  distinct: true,
  offset,
  limit: 10,
  include: [
    {
      model: Thread,
      include: [
        { model: Email, include: [Attachment] },
      ]
    }
  ],
  </code></pre>
  
  <p>})</p>
  
  <hr>
  
  <h3>Associations</h3>
  
  <pre><code>// ThreadFolderUser (assoc table) - Thread / Folder / User (tables)
  User.hasMany(ThreadFolderUser, { foreignKey: 'user_id' })
  ThreadFolderUser.belongsTo(User, { foreignKey: 'user_id' })
  Folder.hasMany(ThreadFolderUser, { foreignKey: 'folder_id' })
  ThreadFolderUser.belongsTo(Folder, { foreignKey: 'folder_id' })
  Thread.hasMany(ThreadFolderUser, { foreignKey: 'thread_id' })
  ThreadFolderUser.belongsTo(Thread, { foreignKey: 'thread_id' })
  
  // Thread - Emails
  Thread.hasMany(Email, { foreignKey: 'thread_id' })
  Email.belongsTo(Thread, { foreignKey: 'thread_id' })
  
  // Email - Attachments
  Email.hasMany(Attachment, { foreignKey: 'email_id' })
  Attachment.belongsTo(Email, { foreignKey: 'email_id' })
  </code></pre>
  
  <hr>
  
  <h3>What do you expect to happen?</h3>
  
  <p>I expected 10 records (based on the limit currently set to 10) retrieved from the AssociationTable, since I have at least 15 records in the database that match this query. </p>
  
  <h3>What is actually happening?</h3>
  
  <p>Returns 6 in my case, instead of 10 (with the limit set to 10). Instead of pulling the first 10 matches.</p>
  
  <hr>
  
  <h3>Additional context</h3>
  
  <p>If I remove the <strong>limit</strong>, it works as intended (even with the includes).</p>
  
  <p>If I remove the <strong>include</strong>, it works as intended (even with the limit). </p>
  
  <p><strong>If I copy/paste the SQL Query generated by Sequelize and insert it directly into Workbench, it retrieves the proper amount of rows.</strong></p>
  
  <p>It seems the issue is the <strong>limit</strong> combined with the <strong>include</strong> cause the query to retrieve only the records that match within the first 10 searched in the DB.</p>
  
  <hr>
  
  <p>Other references to the same issue without a proper solution presented:</p>
  
  <ul>
  <li><p><a href="https://github.com/sequelize/sequelize/issues/7344" rel="noreferrer">https://github.com/sequelize/sequelize/issues/7344</a></p></li>
  <li><p><a href="https://github.com/sequelize/sequelize/issues/7585" rel="noreferrer">https://github.com/sequelize/sequelize/issues/7585</a></p></li>
  <li><p><a href="https://stackoverflow.com/questions/28174502/sequelize-limit-include-association">Sequelize limit include association</a></p></li>
  </ul>
  
  <hr>
  
  <h3>Environment</h3>
  
  <ul>
  <li>Sequelize version: v5.21.3</li>
  <li>Node.js version: v12.13.1</li>
  <li>Operating System: AWS Lambda Function</li>
  <li>TypeScript version: 3.7.2</li>
  </ul>
  
  <hr>
  
  <p>I'm well aware that this exact same issue has been brought up in multiple other threads and platforms -- as I have linked a few of them above -- however none of them have a direct answer, and 1 of them marked an irrelevant point as the answer which did not solve the intended issue. I'm hoping we can get an answer to this, or a realistic workaround beyond hard coding the SQL Query (last resort). </p>
  
  <p>It would be unthinkable for Sequelize not to be able to handle a limit with an include in the same query, so there must be something missing / user error on my side. I've searched multiple times and certainly started with Sequelize documentation, of which does not reference this issue or a similar example, or any problems that may arise with combining a limit and include. </p>
  
  <p>Many thanks for any contributions made to help solve this issue. Hopefully some @Sequelize Engineer is out there able to help answer this :)</p>