הוספתי את השאילתא למטה יש את הריבעון
ELECT M.Name, count(*) as COUNTM FROM Madicine M,Prescription P,Visit V WHERE V.VisitID=P.VisitID and P.MedID=M.MedicineID and year(V.Date)=2007 group by M.Name HAVING COUNTM <= ALL (SELECT COUNT(*) FROM Madicine M1,Prescription P1,Visit V1 WHERE V1.VisitID=P1.VisitID and P1.MedID=M1.MedicineID and datepart(Quarter,V1.[Date])=2 GROUP BY M1.Name)