title: Need help finding only Employees and Sales Persons in SQL
body: <p>I am trying to run an SQL query which would fetch me all people who are
  1. Only employees, 
  2. Employees and a sales person and 
  3. Only sales persons. 
  I am working on the Oracle E-Business Suite. So far, my query returns only those people who are employees only and those people who are employees and also a sales person. Here is what I've managed so far:</p>
  
  <pre><code>select distinct PAF.LAST_NAME,
    PAF.START_DATE "HIRE_DATE",
    PAF.EMPLOYEE_NUMBER,
    PPT.SYSTEM_PERSON_TYPE "PERSON_TYPE",
    JRS.SALES_CREDIT_TYPE_ID,
    JRS.SALESREP_NUMBER
  from PER_ALL_PEOPLE_F PAF,
    PER_PERSON_TYPES PPT,
    PER_PERSON_TYPE_USAGES_F PPTU,
    JTF_RS_DEFRESOURCES_VL JRDV,
    JTF_RS_SALESREPS JRS
  where PAF.PERSON_ID          = PPTU.PERSON_ID                
  and PPTU.PERSON_TYPE_ID      = PPT.PERSON_TYPE_ID             
  and PPT.SYSTEM_PERSON_TYPE  in ('EMP','OTHER')
  and JRDV.category           in ('EMPLOYEE','OTHER')
  and (JRS.SALESREP_NUMBER(+) = PAF.EMPLOYEE_NUMBER)
  and sysdate between PAF.EFFECTIVE_START_DATE and PAF.EFFECTIVE_END_DATE;
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/2hEJm.jpg" rel="nofollow">This is what I want to achieve</a></p>
  
  <p>I have to include those people who are ONLY salespersons. Basically, there should be some rows which have no Employee_Number but only SALESREP_NUMBER. What am I doing wrong?</p>