Malinda Klein
asked on
How to add sum and grouping to a complex query
I want to group by invoice number and sum the cost for the attached MYSQL query and resulting report but when I add group by `INV`.`INVOICE_NUMBER` I get no records found when I try to Select * from (complex query) group by `INV`.`INVOICE_NUMBER`
complexquery.txt
complexquery.txt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Completely opposite point of view..I am a big fan of offloading everything I can to a single point of interest...in this case the MySQL server..if you can do it in a server why recompile the code
So probably it would be
Select [invoice Num],Sum(Cost) as Total Cost from your query Group By [Invoice Num]