VbzCart/docs/procs/Upd DeptIttyps fr TitleIttyps

From Woozle Writes Code
< VbzCart‎ | docs‎ | procs
Revision as of 20:16, 8 March 2009 by imported>Woozle (New page: ==About== * '''Input''': {{vbzcart|table|_title_ittyps}} (grouped by ID_ItTyp, ID_Dept) * '''Output''': {{vbzcart|table|_dept_ittyps}} (replace) ==SQL== <section begin=sql /><mysql>CREATE ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

SQL

<section begin=sql /><mysql>CREATE PROCEDURE Upd_DeptIttyps_fr_TitleIttyps()

 REPLACE INTO _dept_ittyps(ID_ItTyp,ID_Dept,cntForSale,cntInPrint,qtyInStock)
 SELECT
   ID_ItTyp,
   ID_Dept,
   SUM(cntForSale) AS cntForSale,
   SUM(cntInPrint) AS cntInPrint,
   SUM(qtyInStock) AS qtyInStock
 FROM _title_ittyps
 GROUP BY ID_ItTyp, ID_Dept;</mysql>

<section end=sql />