select skuId, forecast_qty, forecast_amt from tbl_MFR_TPF_Detail#_tpfSuffix# with (nolock) where convert( int, forecast_year ) >= and forecast_amt > 0 and forecast_qty > 0 and mfr_id = and forecast_status = 'A' and productLevel = 'SKU' and tpartnerType = 'CDR' select skuId, netWeight, avg( perLb ) unitPricePerLb, avg( perCase ) unitPricePerCase from qmd_actuals where calculated = 'Y' group by skuId, netWeight update tbl_PRD_SKUs set unitPrice = , customFld_6 = 'unitPriceSet' where skuId = and ownerId = and fsl_tablecode = 'MFR' select p.prodId, avg( s.unitPrice ) unitPrice from tbl_PRD_Skus s inner join tbl_PRD_Products p on p.prodId = s.prodId where s.customFld_6 = 'unitPriceSet' and s.ownerId = and s.fsl_tablecode = 'MFR' group by p.prodId update tbl_PRD_Products set averageUnitPrice = , customFld_6 = 'unitPriceSet' where prodId = and ownerId = and fsl_tablecode = 'MFR'