title: MYSQL How do I Select all emails from a table but limit number of emails with the same domain
body: <p>As the topic sugests I want to select all emails in the list. But limit the number of emails with the same domain.</p>
  
  <p>Lets say i have 500 gmail adressses.</p>
  
  <p>And 2 example.com adresses.</p>
  
  <p>.. and so on..</p>
  
  <blockquote>
    <p>I want to just grab 2 of each adress with the same domain.</p>
  </blockquote>
  
  <p>With this string i can select the number of domains that accurs on each domain so maybe I can do something with this string.</p>
  
  <pre><code>SELECT substring_index(email, '@', -1), COUNT(*) FROM emaillist GROUP
  BY substring_index(email, '@', -1);
  </code></pre>
  
  <p>Please help!</p>