VbzCart/queries/qryCtg src sub

About

 * Requires:
 * Queries:, ,
 * Tables:, ,
 * Used by: catalog building process (details to be documented)
 * History:
 * 2008-03-15 Building sequence completely rewritten, so presumably this query was created then
 * 2009-05-03 (dev note) Moved doc to separate page; added query to main server (no design change)

SQL
CREATE OR REPLACE VIEW qryCtg_src_sub AS SELECT NULLIF(CONCAT_WS('/',g.Code,gt.GroupCode,o.CatKey),'') AS CatSfx, c.isCloseOut, gt.ID AS ID_CTG_Title, gi.ID AS ID_CTG_Item, gt.ID_Group AS ID_CTG_Group,  /* mainly for debugging */ gt.ID_Source AS ID_CTG_Source, /* mainly for debugging */ gt.ID_Title, gi.ID_ItTyp, gi.ID_ItOpt, gi.ID_ShipCost, gi.PriceBuy, gi.PriceSell, gi.PriceList, IFNULL(gi.Descr,CONCAT_WS(' / ',gt.GroupDescr,o.Descr)) AS ItOpt_Descr_part, it.NameSng, gi.Descr AS GrpItmDescr, gt.GroupDescr AS TitleGroupDescr, o.Descr AS OptionDescr, CONCAT(g.Sort,it.Sort,o.Sort) AS ItOpt_Sort, gt.GroupCode AS GrpCode, gt.GroupDescr AS GrpDescr, gt.GroupSort AS GrpSort FROM (   (      (        (          qryCtg_Titles_active AS gt LEFT JOIN ctg_groups AS g ON g.ID=gt.ID_Group ) LEFT JOIN qryCtg_Sources_active AS c ON gt.ID_Source=c.ID      ) LEFT JOIN qryCtg_Items_active AS gi ON gi.ID_Group=g.ID     ) LEFT JOIN cat_ioptns AS o ON gi.ID_ItOpt=o.ID   ) LEFT JOIN cat_ittyps AS it ON gi.ID_ItTyp = it.ID WHERE (c.ID IS NOT NULL) AND (gi.ID IS NOT NULL);