VbzCart/procs/Upd Titles fr CatItems

About

 * Action: sets some fields in after that has been filled in by
 * Input:
 * Output: : cntForSale, cntInPrint, qtyInStock
 * History:
 * 2010-11-10
 * Added DROP PROCEDURE for easier maintenance.
 * Added to database (procs did not get ported from L48 to Rizzo).
 * i.qtyInStock -> i.qtyIn_Stk

SQL
DROP PROCEDURE IF EXISTS Upd_Titles_fr_CatItems; CREATE PROCEDURE Upd_Titles_fr_CatItems UPDATE _titles AS t LEFT JOIN (     SELECT        ID_Title,        SUM(IF(i.isForSale,1,0)) AS cntForSale,        SUM(IF(i.isInPrint,1,0)) AS cntInPrint,        SUM(i.qtyIn_Stk) AS qtyInStock,        MIN(i.PriceSell) AS currMinSell,        MAX(i.PriceSell) AS currMaxSell       FROM cat_items AS i GROUP BY ID_Title      ) AS ig ON ig.ID_Title=t.ID      SET t.cntForSale = ig.cntForSale, t.cntInPrint = ig.cntInPrint, t.qtyInStock = ig.qtyInStock;