Difference between revisions of "VbzCart/queries/qryCat Depts"
Jump to navigation
Jump to search
(moved from single-page listing) |
(→SQL: +isActive; created About section) |
||
Line 1: | Line 1: | ||
+ | ==About== | ||
+ | * '''Requires''': {{vbzcart/table|cat_depts}}, {{vbzcart/table|cat_supp}} | ||
+ | * '''History''': | ||
+ | ** '''2008-12-11''' Added isActive field (from {{vbzcart/table|cat_depts}}) so that {{vbzcart/query|qryCbx_Depts}} can show only active depts | ||
==SQL== | ==SQL== | ||
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryCat_Depts AS | <section begin=sql /><mysql>CREATE OR REPLACE VIEW qryCat_Depts AS | ||
Line 7: | Line 11: | ||
d.CatKey, | d.CatKey, | ||
UPPER(IFNULL(d.PageKey,d.CatKey)) AS CatKey_def, | UPPER(IFNULL(d.PageKey,d.CatKey)) AS CatKey_def, | ||
+ | d.isActive, | ||
d.ID_Supplier, | d.ID_Supplier, | ||
UPPER(CONCAT_WS('-',s.CatKey,d.CatKey)) AS CatNum, | UPPER(CONCAT_WS('-',s.CatKey,d.CatKey)) AS CatNum, |
Latest revision as of 18:06, 11 December 2008
About
- Requires:
- REDIRECT Template:l/vc/table, cat_supp
- History:
- 2008-12-11 Added isActive field (from cat_depts) so that
- REDIRECT Template:l/vc/query can show only active depts
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.isActive, 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>