Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
like if a have query like this

select sum(salary) as 'monthly salary' from salarydetails(table)..
how to find like this
the sum(sum(salary)) as 'total salary'.....
Posted
Comments
[no name] 21-Nov-14 7:08am    
Why do you want that ?
_Asif_ 21-Nov-14 7:08am    
What have you tried so far?
Tomas Takac 21-Nov-14 7:23am    
Is there a group by cluase in your query? Can you post the whole query for monthly salary?

1 solution

Try this

SQL
With MonthSalCTE
As
(
select sum(salary) as 'monthly salary'
from salarydetails
)
select SUM([monthly salary]) from MonthSalCTE;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900