title: SQL distinct values between different queries
body: <p>I have the following query</p>
  
  <pre><code>select distinct 
  people.id
  from people
  inner join incident on people.id = incident.peopleid 
  where  incident.service =4
  AND people.id NOT IN (
  select  incident.peopleid
  from Incident
  where 
  incident.service IN =4
  AND incident.ServiceInterrupt != 0
  )
  </code></pre>
  
  <p>that gives me all the people that belong to a service and they havent interrupt that service yet.
  I want to run this query for service 5 and 6 and for these results take only the unique people.
   Till now, i run the query 3 times (changing the service each time) and then i remove the duplicates with excel!!! 
  Is there an other way to do it?</p>
  
  <p>thanks in advance</p>
  
  <p>EDIT: To be more specific i want from the results to exclude all people in service X that have interrupt service X only. That is why i cant use incident.service in (4,5,6) instead on incident.service=4</p>