ryan010101
Technical User
Three tables:
items_on_programs, execsales, catalog
Below is the current query I have which uses items_on_programs and execsales. The results displays a list of SKUs and shows how manu were ordered (SUM(e.qty_orderd). I need to not just display the SKU, but also the product name and UPC for the SKU in question, this is stored in the table "catalog". I'm not sure how to go about adding that table into the mix. Any help would be appreciated.
SELECT i.id, i.program_id, i.sku, i.controlled_funds, i.approved, i.buyin_expected, i.buyin_actual, i.item_cost, Sum(e.qty_ordered) As Qty FROM items_on_programs i LEFT JOIN excsales e ON i.sku = e.sku
WHERE i.program_id = 22
GROUP BY i.id, i.program_id, i.sku, i.controlled_funds, i.approved, i.buyin_expected, i.buyin_actual, i.item_cost
thanks
Ryan
items_on_programs, execsales, catalog
Below is the current query I have which uses items_on_programs and execsales. The results displays a list of SKUs and shows how manu were ordered (SUM(e.qty_orderd). I need to not just display the SKU, but also the product name and UPC for the SKU in question, this is stored in the table "catalog". I'm not sure how to go about adding that table into the mix. Any help would be appreciated.
SELECT i.id, i.program_id, i.sku, i.controlled_funds, i.approved, i.buyin_expected, i.buyin_actual, i.item_cost, Sum(e.qty_ordered) As Qty FROM items_on_programs i LEFT JOIN excsales e ON i.sku = e.sku
WHERE i.program_id = 22
GROUP BY i.id, i.program_id, i.sku, i.controlled_funds, i.approved, i.buyin_expected, i.buyin_actual, i.item_cost
thanks
Ryan