Difference between revisions of "VbzCart/queries/qryStk lines remaining byBin"

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
(created)
 
(updated because of name-change in underlying query)
Line 1: Line 1:
 
==About==
 
==About==
 
* '''Returns''': list of bins, with stock quantities for each (for sale, for shipping, existing)
 
* '''Returns''': list of bins, with stock quantities for each (for sale, for shipping, existing)
* '''Requires''': {{vbzcart/query|v_stk_lines_remaining}}
+
* '''Requires''': {{vbzcart/query|qryStk_lines_remaining}}
 
* '''Used by''': {{vbzcart/query|qryStk_Bins_w_info}}
 
* '''Used by''': {{vbzcart/query|qryStk_Bins_w_info}}
 
* '''History''':
 
* '''History''':
 
** '''2009-04-29''' Created for Special:VbzAdmin
 
** '''2009-04-29''' Created for Special:VbzAdmin
 +
** '''2009-11-29''' Updated to reflect name change of source query
 
==SQL==
 
==SQL==
 
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryStk_lines_remaining_byBin AS
 
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryStk_lines_remaining_byBin AS
Line 12: Line 13:
 
     SUM(QtyForShip) AS QtyForShip,
 
     SUM(QtyForShip) AS QtyForShip,
 
     SUM(QtyExisting) AS QtyExisting
 
     SUM(QtyExisting) AS QtyExisting
   FROM v_stk_lines_remaining GROUP BY ID_Bin;</mysql>
+
   FROM qryStk_lines_remaining
 +
  GROUP BY ID_Bin;</mysql>
 
<section end=sql />
 
<section end=sql />

Revision as of 23:04, 29 November 2009

About

  • Returns: list of bins, with stock quantities for each (for sale, for shipping, existing)
  • Requires:
  1. REDIRECT Template:l/vc/query
  • Used by: qryStk_Bins_w_info
  • History:
    • 2009-04-29 Created for Special:VbzAdmin
    • 2009-11-29 Updated to reflect name change of source query

SQL

<mysql>CREATE OR REPLACE VIEW qryStk_lines_remaining_byBin AS

 SELECT
   ID_Bin,
   SUM(QtyForSale) AS QtyForSale,
   SUM(QtyForShip) AS QtyForShip,
   SUM(QtyExisting) AS QtyExisting
 FROM qryStk_lines_remaining
 GROUP BY ID_Bin;</mysql>