title: Sequelize with NodeJS can't join tables with limit
body: <p>I'm trying to implement a simple query that should look like this:</p>
  
  <pre><code>select * from property join entity_area on property.id=entity_area.entity_id and entity_area.area_id=1 where property.price&gt;300000 limit 12
  </code></pre>
  
  <p>Pretty straightforward: I want to get the joined result and then to limit to 12.</p>
  
  <p>In Sequelize i'm using the following function:</p>
  
  <pre><code>return models.property.findAll(
  {
      where: ["price&gt;=?", 300000],
      include: [
      {
          model:models.entity_area,
          where: { area_id:1 }
      }
      ],
      limit:12
  })
  </code></pre>
  
  <p>But this code generates the following sql:</p>
  
  <pre><code>select property.*, entity_area.* from (select * from property where property.price&gt;300000 limit 12) join entity_area on property.id=entity_area.entity_id and entity_area.area_id=1
  </code></pre>
  
  <p>Which has totally different logic from what i'm trying to do because in the generated sql it first gets any 12 results and then tries to join with entity_area, and of course the random 12 results don't necessarily match the entity_area, so i'm getting no results back.</p>
  
  <p>Please suggest me a proper way of doing it. The property table is very massive, and i have to use the "limit" rather than getting all the results and slicing them in javascript. Also i wouldn't like to start using raw queries. </p>