, ( )
Select Max(sumHrs)
From (Select sum(hours) sumHrs
From works_on
gtoup by pno) z
I wonder what is the value of returning multiple rows from a result set, which is already an aggregation, and not raw data rows. If your desired results also included a value pno, then I would understand (you want to know which one pnohas the greatest amount of hours), but just getting the maximum amount of hours doesn't seem to matter much, Or did you just leave part of the problem, just for simplicity?
source
share