Answers for "mysql select inside sum"

SQL
0

mysql select inside sum

SELECT x.prod_name
     , SUM(x.total)
  FROM ( SELECT bp.prod_name
              , ( SELECT SUM( wh.quantity ) * bp.weight 
                    FROM bus_warehouse_entries wh
                   WHERE bp.prod_code = wh.org_product_code ) AS total
       FROM bus_products bp ) x
 GROUP BY x.prod_name
Posted by: Guest on April-14-2020

Code answers related to "SQL"

Browse Popular Code Answers by Language