Get max of sum(col)
450482Dec 4 2007 — edited Dec 5 2007Hi
select col1, sum(col2) as sm
from
(huge complex query)
How can I select the max(sm) along with col1? Other than using the following method:
select col, sum(col2) as sm from (<huge query>) where
sum(col2) = (select max(sm) from <huge complex query>)