>select V.patient_name, V.visit_date, V.doctor_name, DOCTORS.doctor_specialty > >from Visits V INNER JOIN DOCTORS ON V.doctor_name=DOCTORS.doctor_name > >WHERE EXISTS(SELECT patient_name, visit_date FROM Visits > > WHERE patient_name=V.patient_name > > AND visit_date=V.visit_date > >group by patient_name, visit_date > >having count(VISITS.visit_date)>1 > >) > >>
>SELECT Doctors.*, Visits.* > FROM Doctors > INNER JOIN > ( SELECT VISITS.patient_name, VISITS.visit_date > FROM VISITS > GROUP BY VISITS.patient_name, VISITS.visit_date > HAVING (((count(VISITS.visit_date))>1)) ) as SubQ > INNER JOIN Visits ON > (SubQ.Visit_Date = Visits.Visit_Date) AND (SubQ.Patient_Name = Visits.Patient_Name)) > ON Doctors.Doctor_Name = Visits.Doctor_Name; >>
SELECT Customers.*,Orders.* FROM Customers INNER JOIN ( (SELECT orders.shipvia, orders.shippeddate FROM orders GROUP BY orders.shipvia, orders.shippeddate HAVING (((count(orders.shippeddate))=5)) ) as SubQ INNER JOIN Orders ON (SubQ.ShippedDate = orders.shippeddate) AND (SubQ.ShipVia = orders.ShipVia)) ON Customers.customerID=orders.customerID;Cetin