I need to get all values operated with a MULTIPLY() instead of a SUM() in a query like this (simplified):
SELECT aav.id, COUNT(al.id_product) AS num_products, MULTIPLY(al.prop) AS mul_prop
FROM a_table a
JOIN v_table aav ON a.id = aav.id_article AND a.fecha > '2020-01-13 11:28:54'
JOIN l_table al ON al.id_article = aav.id_article
JOIN l_table al2 ON al.id_article= al2.id_article AND al2.id_product = 113288
WHERE aav.id_attrib IN (SELECT a.id FROM attrib a WHERE a.key= 'my_key')
GROUP BY id_article HAVING num_products > 2
I'm looking for a light-weight solution, without creating a view or a temporary table, I'm just looking for a function like MULTIPLY() in OpenOffice.
My objective is to have negative, positive and zero cells when exists some products with prop=0, some negative prop products, or all positive prop products, it is for visual purpose. Any idea? I see MySQL don't have a MULTIPLY() function :/