VbzCart/docs/queries/qryCat Items Stock
Jump to navigation
Jump to search
About
- Requires: Template:Vbzcart, Template:Vbzcart/query
- Used by: Template:Vbzcart/query
- Notes: This may turn out to be inefficient, since it retrieves a lot of data which may not be needed
- History:
- 2009-04-12 Created to replace cat_items.qtyInStock field
- 2009-11-29 Underlying query renamed
SQL
<section begin=sql /><mysql>CREATE OR REPLACE VIEW qryCat_Items_Stock AS SELECT
i.*, SUM(st.qtyForSale) AS qtyForSale, SUM(st.qtyForShip) AS qtyForShip
FROM (cat_items AS i LEFT JOIN qryStk_items_remaining AS st on i.ID=st.ID_Item) GROUP BY i.ID;</mysql> <section end=sql />