VbzCart/docs/queries/qryStk byItem byBin wInfo: Difference between revisions

From Woozle Writes Code
< VbzCart‎ | docs‎ | queries
Jump to navigation Jump to search
imported>Woozle
(about: 2 tables also required)
imported>Woozle
(+PlcName, -PlcDescr)
Line 4: Line 4:
* '''History''':
* '''History''':
** '''2009-02-07''' Added p.Descr so "stock needed for orders" can show where bins are
** '''2009-02-07''' Added p.Descr so "stock needed for orders" can show where bins are
** '''2009-04-24''' Added p.Name, which is what "stock needed for orders" should be showing
*** commenting out p.Descr->PlcDescr because it probably isn't needed
==SQL==
==SQL==
<section begin=sql /><mysql>CREATE OR REPLACE VIEW v_stk_byItemAndBin_wInfo AS
<section begin=sql /><mysql>CREATE OR REPLACE VIEW v_stk_byItemAndBin_wInfo AS
Line 12: Line 14:
     b.Code AS BinCode,
     b.Code AS BinCode,
     b.Descr AS BinDescr,
     b.Descr AS BinDescr,
     p.Descr AS PlcDescr
     p.Name AS PlcName
/*    p.Descr AS PlcDescr */
   FROM
   FROM
   ((
   ((

Revision as of 02:12, 25 April 2009

About

SQL

<section begin=sql /><mysql>CREATE OR REPLACE VIEW v_stk_byItemAndBin_wInfo AS

 SELECT
   s.*,
   i.*,
   b.ID_Place,
   b.Code AS BinCode,
   b.Descr AS BinDescr,
   p.Name AS PlcName

/* p.Descr AS PlcDescr */

 FROM
 ((
     v_stk_byItemAndBin AS s LEFT JOIN qryCat_Items AS i ON s.ID_Item=i.ID
   ) LEFT JOIN stk_bins AS b ON s.ID_Bin=b.ID
 ) LEFT JOIN stk_places AS p ON b.ID_Place=p.ID;</mysql>

<section end=sql />