title: How can I LIMIT on various WHERE clauses in MySQL?
body: <p>Let's say I have the following MySQL table:</p>
  
  <pre>
  id | species
  ------------
  1  | dog
  2  | dog
  3  | dog
  4  | cat
  5  | cat
  6  | fish
  7  | fish
  8  | fish
  </pre>
  
  <p>I want to get the ids of 2 dogs, 1 cat, and 1 fish (they don't have to be in order). For example, {1, 2, 4, 6} would be a valid output.</p>
  
  <p>Is there a way to do this in one SQL query? As far as I know, LIMIT is a fairly simple operator that can't do this. Maybe WHERE can be manipulated? Or would multiple SQL queries be the best way of doing this?</p>