title: How to do equivalent of "limit distinct"?
body: <p>How can I limit a result set to <em>n</em> distinct values of a given column(s), where the actual number of rows may be higher?</p>
  
  <p>Input table:</p>
  
  <pre><code>client_id, employer_id, other_value
  1, 2, abc
  1, 3, defg
  2, 3, dkfjh
  3, 1, ldkfjkj
  4, 4, dlkfjk
  4, 5, 342
  4, 6, dkj
  5, 1, dlkfj
  6, 1, 34kjf
  7, 7, 34kjf
  8, 6, lkjkj
  8, 7, 23kj
  </code></pre>
  
  <p>desired output, where limit distinct=5 distinct values of client_id:</p>
  
  <pre><code>1, 2, abc
  1, 3, defg
  2, 3, dkfjh
  3, 1, ldkfjkj
  4, 4, dlkfjk
  4, 5, 342
  4, 6, dkj
  5, 1, dlkfj
  </code></pre>
  
  <p>Platform this is intended for is MySQL.</p>