Page 1 of 1

sum with group by filter value

Posted: 2021-06-22 12:21
by onyr
Hi,

I need to show only value for "Salted Water" product on "Provided" from table using sum with sql calculated fields.

My formula is:

SELECT SUM(`stockin`.`sti_qtty`)
FROM `site`
LEFT JOIN `stockin` ON `stockin`.`sti_sit_id`=`site`.`sit_id`
WHERE `site`.`sit_id`='%ID%'

But it's all sum for all products.

Where I can insert "Group By" and "Where" value is from my formula?

Regards