67
SELECT ODate, SUM (AMT) FROM Orders a GROUP BY
ODate HAVING SUM (AMT) > (SELECT 2000.00 + MAX (AMT)
FROM Orders b WHERE a.ODate = b.ODate);
Ostki so„rov asosiy so„rovning ko„rilayotgan agregat guruxi
sanasiga teng sanaga ega xmma satrlar uchun MAX qiymat xisoblaydi.
Bu WHERE ifodasidan foydalanib bajarilishi lozim. Ostki so„rovning
o„zi GROUP BY yoki HAVING operatorlarini ishlatmasligi kerak.
Dostları ilə paylaş: