VbzCart/queries/qryCat Depts

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< VbzCart‎ | queries
Revision as of 18:25, 30 November 2008 by Woozle (talk | contribs) (moved from single-page listing)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

SQL

<mysql>CREATE OR REPLACE VIEW qryCat_Depts AS

 SELECT
   d.ID,
   d.Name,
   d.Sort,
   d.CatKey,
   UPPER(IFNULL(d.PageKey,d.CatKey)) AS CatKey_def,
   d.ID_Supplier,
   UPPER(CONCAT_WS('-',s.CatKey,d.CatKey)) AS CatNum,
   LOWER(CONCAT_WS("/",s.CatKey,IFNULL(d.PageKey,d.CatKey))) AS CatWeb_Dept,
   LOWER(CONCAT_WS("/",s.CatKey,d.CatKey)) AS CatWeb_Title
 FROM cat_depts AS d LEFT JOIN cat_supp AS s ON d.ID_Supplier=s.ID;</mysql>