title: SQL Server (MSSql) not exists
body: <p>i got a problem with selecting data on four Tables.
  first is </p>
  
  <p><strong>Users</strong></p>
  
  <pre><code>id    |    group_id    |    username
  1          10                foo
  2          10                bar
  3          20                barfoo
  </code></pre>
  
  <p>second is </p>
  
  <p><strong>Groups</strong></p>
  
  <pre><code>id    |    groupname
  
  10          foo
  20          bar
  </code></pre>
  
  <p>thrid is</p>
  
  <p><strong>mapping</strong></p>
  
  <pre><code>group_id    |    user_id    |    permission_id
  
   10                  1                100
   10                  1                200
   10                  2                100
   20                  3                300
   20                  3                400
  </code></pre>
  
  <p>and finaly</p>
  
  <p><strong>permissions</strong></p>
  
  <pre><code>id    |    value    | group_id
  
  100          A            10  
  200          B            10
  300          B            20
  400          A            20
  </code></pre>
  
  <p>what i'm trying to do is to select users who have the permission "A" but not the permission "B"
  its a kind of plausybility check, because users in the same grop shold have the same permissions, in this case user bar should be the only result. maybe someone has a hint?
  Thank you!</p>