Difference between revisions of "VbzCart/queries/qryCat Titles"

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
(Descr field)
(t.Search, duh)
Line 5: Line 5:
 
* '''History''':
 
* '''History''':
 
** '''2010-11-06''' Changed '''CatKey_Title''' back to '''CatKey''' because "Title" should be the default context for this query
 
** '''2010-11-06''' Changed '''CatKey_Title''' back to '''CatKey''' because "Title" should be the default context for this query
** '''2011-01-29''' Added "t.Desc AS Descr" to help with searching; t.Desc should eventually be renamed to t.Descr because "DESC" is an SQL keyword
+
** '''2011-01-29''' Added "t.Desc AS Descr" and "t.Search" to help with searching; t.Desc should eventually be renamed to t.Descr because "DESC" is an SQL keyword
 
==SQL==
 
==SQL==
 
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryCat_Titles AS
 
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryCat_Titles AS
Line 12: Line 12:
 
     t.Name,
 
     t.Name,
 
     t.Desc AS Descr,
 
     t.Desc AS Descr,
 +
    t.Search,
 
     UPPER(CONCAT_WS("-",d.CatNum,t.CatKey)) AS CatNum,
 
     UPPER(CONCAT_WS("-",d.CatNum,t.CatKey)) AS CatNum,
 
     LOWER(CONCAT_WS("/",d.CatWeb_Title,t.CatKey)) AS CatWeb,
 
     LOWER(CONCAT_WS("/",d.CatWeb_Title,t.CatKey)) AS CatWeb,

Revision as of 18:53, 29 January 2011

Details

  1. REDIRECT Template:l/vc/query
  • Fields:
    • CatKey is used in the catalog-building process (Enter Title Groups) when searching within a supplier for a particular title
  • History:
    • 2010-11-06 Changed CatKey_Title back to CatKey because "Title" should be the default context for this query
    • 2011-01-29 Added "t.Desc AS Descr" and "t.Search" to help with searching; t.Desc should eventually be renamed to t.Descr because "DESC" is an SQL keyword

SQL

<mysql>CREATE OR REPLACE VIEW qryCat_Titles AS

 SELECT
   t.ID,
   t.Name,
   t.Desc AS Descr,
   t.Search,
   UPPER(CONCAT_WS("-",d.CatNum,t.CatKey)) AS CatNum,
   LOWER(CONCAT_WS("/",d.CatWeb_Title,t.CatKey)) AS CatWeb,
   t.CatKey,
   d.ID_Supplier,
   t.ID_Dept,
   t.DateAdded,
   t.RstkMin AS QtyMin_Rstk,
   t.Notes,
   t.Supplier_CatNum AS Supp_CatNum
 FROM cat_titles AS t LEFT JOIN qryCat_Depts AS d ON t.ID_Dept=d.ID;</mysql>