title: MySQL: get multiple-keyed rows matching several WHERE conditions (probably simple)
body: <p>I have a table of userdata that includes user ID and category IDs. I want to grab all of the users that are associated with multiple category IDs, eg:</p>
  
  <p><code>id | UserID | CategoryID</code></p>
  
  <p><code>1 | 123456 | 999</code></p>
  
  <p><code>2 | 123456 | 888</code></p>
  
  <p><code>3 | 123457 | 999</code></p>
  
  <p><code>4 | 123458 | 777</code></p>
  
  <p>So for example, if I wanted to get all users with a categoryID of 999, I'd get 123456 and 123457. I <em>need</em> to get all users with a categoryID of 999 <strong>and</strong> 888, which in this case should only give me user 123456. I can't figure out how to write a query to give me this data.</p>
  
  <p>Can anyone help?</p>