Hi
i'm having a little trouble with a query i am writing (MySQL knowledge is limited)
i am trying to get the sum of a result from another query if that makes sense,
i have this query working
$sqlQuery = new SQLQuery(
"Recipe.Weight * Product.CostPrice",
"Recipe, Product",
"Product.ID = " . $this->owner->ProductID
);
$Price = $sqlQuery->execute()->value();
return $Price;
so i would now like to sum all the results by Recipe.QuoteID. i have looked at several ways of doing this but not having much luck as im at the edge of my understanding of this stuff.
i think it needs to create an array of results from the above query and then sum them but i'm not sure if this is correct.