1
Sum of a product returning in a column the total
Guys good night, I wonder how I can make a SELECT that returns exactly the same as what is below (I modified in F12 to see if you can understand better)
i made a SELECT that is returning the total value but it is grouping the products see below how it is being returned
sql = SELECT *, SUM(qty_product) FROM quintada_management total GROUP BY name_product
how could solve this "problem"?
You wouldn’t have to group id_m_product instead of name_product?
– Heitor Scalabrini
You want to take all the fields of a random line of that product, among all the lines of that product, and at the end add the total amount of that?
– anonimo
@anonimo That’s right, I want to add the products, and create a column with the total, but I don’t want the same products to be grouped together
– Maycon Yamamotto
@Heitorscalabrini I have already tried to do this, but the total column does not return only the quantity of the product and does not sum
– Maycon Yamamotto