title: Restricting results from a SQL query
body: <p>I am trying to restrict the results returned from a query. If a user has access to more Entities than just those listed for the current user, then that user should not show up on the list. Using the data below, and assuming User 1 is running the query, since the user with UserId 2 has matches that User 1 does not have, even though they have overlapping values, user 2 should be excluded from the results of the query.</p>
  
  <pre><code>Table1
  UserId   EntityId
  1        100
  1        101
  1        102
  2        100
  2        101
  2        102
  2        200
  2        201
  </code></pre>
  
  <p>How do I do this?</p>