SELECT VISITS.patient_name, VISITS.visit_date, Doctors.doctor_Specialty FROM Visits INNER JOIN Doctors ON Visits.Doctor_Name = Doctors.Doctor_Name GROUP BY Patient_Name, Visit_Date, Doctor_Specialty HAVING (count(DISTINCT Doctors.Doctor_Name) >1 AND count(DISTINCT Doctors.Doctor_Specialty)=1);but I'm getting missing operator at the expression in Having clause.