Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Jason Harris — — source: Informix-list mailing list archive (1991-1998)
On 15 Oct 1997 09:13:25 -0400, ssathish@getafix.cmc.net.in (S
SATHISH-SI) wrote:
>Hi,
>Why does Online 7.1 disallow nesting aggregates in queries.
>eg.,
>Select sum(max(sal)) from emp where ... group by ...
>In case i want the sum of the maximum salaries in a department without
>writing a subquery?
>Bye
You need a subquery. Such as this:
select sum((select max(sal) from emp where emp.emp_id=emp2.emp_id))
from emp emp2.
This may be a bad example because you are assuming there are multiple
records in emp. But you get the idea I hope.
Regards
Jason
Jason Harris
Informix DBA
Westpac Banking Corporation
NOTE: I add all these address at the bottom of people who spam me
Now when their extractors extract my e-mail address they will also
end up spamming each other.
wtcjr@ix.netcom.com
Shevsky@hotmail.com
speech@speechrecognition.com
SmartBiz@NevWest.com
slender@juice4u.net
sbliss@earthfriends.com
ron@moneyaction.com
removeme@gwh.net
rocco@lostvegas.com
market@DRAWBRIDGE.NET
Foxyrusski@mail-response.com
emaster@email-man.com
waynesmail@earthlink.net
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.