VbzCart/docs/procs/Upd Titles fr Depts

From Woozle Writes Code
< VbzCart‎ | docs‎ | procs
Revision as of 19:38, 8 March 2009 by imported>Woozle (New page: ==About== * '''Purpose''': Fills {{vbzcart|table|_titles}} ==SQL== <section begin=sql /><mysql> CREATE PROCEDURE Upd_Titles_fr_Depts() REPLACE INTO _titles(ID,ID_Supp,CatNum,CatWeb) ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

SQL

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

   REPLACE INTO _titles(ID,ID_Supp,CatNum,CatWeb)
   SELECT
     t.ID,
     d.ID_Supp,
     UPPER(CONCAT_WS("-",d.CatNum,t.CatKey)) AS CatNum,
     LOWER(CONCAT_WS("/",d.CatWeb_Title,t.CatKey)) AS CatWeb
   FROM titles AS t LEFT JOIN _depts AS d ON t.ID_dept=d.ID
   ORDER BY CatNum;</mysql>

<section end=sql />