MySQL Forums
Forum List  »  Newbie

HOW TO GET GRAND TOTAL
Posted by: rick pizzi
Date: July 15, 2018 03:15PM

Here is a query that gets the total of prices for each invoice in the table invoices.

SELECT invoice.`datepick`,invoice.invno, SUM(materials.`price`) FROM invoice, `materials` WHERE materials.invno=invoice.invno AND YEAR(invoice.datepick)=2015 GROUP BY invoice.invno ORDER BY invoice.datepick

Is there a way to get the GRAND Total of all the invoices without submiting another query? Like SUM(SUM(materials.`price`))

Thanks in advance for the help.

R

Options: ReplyQuote


Subject
Written By
Posted
HOW TO GET GRAND TOTAL
July 15, 2018 03:15PM
July 15, 2018 09:56PM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.