title: Get error "ORA-00920: invalid relational operator" on count within where clause
body: <p>This is an employee to dependent relationship. I am having trouble displaying only the employee who has more than one dependent. The line that should not be there is for emp_no 555555.</p>
  
  <pre><code> SELECT emp_no, emp_name, dep_emp_no, dep_name, dep_relationship, trunc(MONTHS_BETWEEN(current_date, dep_date_of_birth)/12) "Age"
   FROM DEPENDENT d JOIN employee e ON e.emp_no=d.dep_emp_no
  WHERE dep_date_of_birth=(SELECT MIN(DEP_DATE_OF_BIRTH) FROM DEPENDENT dd WHERE d.dep_emp_no=dd.dep_emp_no)
  
  
   EMP_NO EMP_NAME                       DEP_EM DEP_NAME             DEP_RELATI        Age
   ------ ------------------------------ ------ -------------------- ---------- ----------
   444444 Hickman, Ron                   444444 Amy                  DAUGHTER           22
   555555 Moore, Wayne                   555555 Sharon               SPOUSE             65
   111111 Li, Anna                       111111 Chris                SON                 8
  </code></pre>
  
  <p>This is what is giving me the error:</p>
  
  <pre><code> SELECT emp_no, 
          emp_name, 
          dep_emp_no, 
          dep_name, 
          dep_relationship, 
          trunc(MONTHS_BETWEEN(current_date, dep_date_of_birth)/12) "Age"
     FROM DEPENDENT d 
     JOIN employee e ON e.emp_no=d.dep_emp_no
    WHERE dep_date_of_birth=(SELECT MIN(DEP_DATE_OF_BIRTH) 
                               FROM DEPENDENT dd 
                              WHERE d.dep_emp_no=dd.dep_emp_no)
   and where DEP_EMP_NO exists (select count(dep_emp_no) 
                                  from dependent 
                                having count(dep_emp_no)&gt;1 
                              group by dep_emp_no);
  </code></pre>