VbzCart/queries/qryCtg Items updates

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search

Details

SQL

<mysql>CREATE OR REPLACE VIEW qryCtg_Items_updates AS

 SELECT
   NULLIF(CONCAT_WS('/',g.Code,gt.GroupCode,o.CatKey),) AS CatSfx,
   gt.ID_Title,
   g.ID AS ID_TGroup,
   gt.ID AS ID_TGTitle,
   gi.ID AS ID_TGItem,
   gt.ID_Source AS ID_TGSource,
   gi.ID_ItTyp, gi.ID_ItOpt
 FROM
 (
   (
     (
       ctg_titles 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 ctg_items AS gi ON gi.ID_Group=g.ID
  ) LEFT JOIN cat_ioptns AS o ON gi.ID_ItOpt=o.ID
 WHERE
   (c.ID IS NOT NULL)
     AND g.isActive
     AND gt.isActive
     AND ((gt.WhenDiscont IS NULL) OR (gt.WhenDiscont>NOW()))
     AND gi.isActive;</mysql>