Search code examples
mysqlphpquery

How can i calculate Grand Total.


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

  • SELECT SUM(amountColumnName) FROM yourTable