VbzCart/docs/queries/qryCat Items Stock

From Woozle Writes Code
< VbzCart‎ | docs‎ | queries
Revision as of 23:23, 29 November 2009 by imported>Woozle (underlying query renamed)
Jump to navigation Jump to search

About

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 />