title: LIMIT result on join MySQL
body: <p>take the case you have 2 table, for example tbCostumers and tbOrders.
  I would like to display a summary list with all costumers, related orders and display them with a paginator.</p>
  
  <p>Doing a join I can extract costumers list and all orders for each costumer, the result is something like:</p>
  
  <pre><code>idCostumer | name | ... | idProduct | productName | price | ...
  </code></pre>
  
  <p>Where the first n columns are all equal if the costumer has more than 1 order. So I can have:</p>
  
  <pre><code>1 | will | ... | 12 | product1 | 123 | ...
  2 | bill | ... | 23 | product2 | 321 | ... 
  2 | bill | ... | 24 | product3 | 231 | ...
  </code></pre>
  
  <p>And so on</p>
  
  <p>I'm trying to use <code>LIMIT</code> to extract only n records and using them with a paginator.</p>
  
  <p>First question: if a costumer has more than 1 order, with this query I'll see n records, equal in the first column (id, name, ... and other costumer info) but different at the end, where there are products info. Is this 'correct'? Is there another way to extract this informations?</p>
  
  <p>Second question: if I do that and I use a <code>LIMIT</code>, I could "cut" the result table between 2 (or more) records that represent the same customer; so, for example in the small table above, if I limit with 2 the third row will be lost, even if it's part of the row above, because is just another order of the same costumer.</p>
  
  <p>I would like to limit the number of different idCostumer, in order to take exactly n costumers, even if they appear more than 1 times in the result table. Something like n different idCostumer, no matter if they are repeated.</p>
  
  <p>Is this possible?</p>
  
  <p>I hope it's clear, it was not easy to explain what I would like to achieve :)</p>
  
  <p>Thank you!</p>