SELECT SUM(amountColumnName) FROM yourTable
How can i calculate Grand Total.
Question
I need grand total i have total Column and also some records.
For example A and B Two columns and these columns amount equal to total.
ColA -------20 + ColB----------20 = Col Total------------40
ColA -------10 + ColB----------40 = Col Total------------50
So know i need grand total. Grand total this should amount be 90.How can i do this i am just need grand total.this should calculate total 40 and 50 equal 90.
Grand Total = 90
Solution 2
OTHER TIPS
So you have a table that looks like this:
ColA | ColB 20 | 20 10 | 40
And you want to output the sum of all those values.
Then I will advise you to sum all the values in the rows and then the values for all those rows this way:
select sum(colA + colB) from table
Of course, if there are more columns you will have to add them inside the sum
function.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow