SampleSQL: List stock where stock supplier.purchase cost is not zero

Page approved.




WARNING icon
Data Query is an Advanced User feature.

This sample Data Query may be useful, for example, when deciding which stock items you wish to stop the stock buy price field from changing.

SELECT sk.stock_code AS stock_code
     , sk.short_desc AS stock_description
     , co.company_code AS supplier_urn
     , co.company_name AS supplier_name
     ,  sks.default_supplier AS default_supplier
     , sks.purchase_cost AS purchase_cost
       FROM stock_supplier AS sks
INNER JOIN stock AS sk ON sks.stock_id = sk.stock_id
LEFT JOIN company AS co ON sks.supplier_id = co.company_id
WHERE sks.stock_id > 0 AND sks.purchase_cost <> '0.00'
ORDER BY sks.stock_code
/************************************************************
  List stock where stock_supplier.purchase_cost is
  not zero

  This data query is provided as a teaching aid and is not
  covered by your support agreement.

  16-Feb-2009                                Created (GKS)
************************************************************/

Contact the Khaos Team