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

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.

[14:58] Leah Knight
SELECT sks.default_supplier AS default_supplier,
sks.purchase_cost AS purchase_cost,
sk.stock_code AS stock_code,
sk.short_desc AS stock_description,
co.company_code AS supplier_urn,
co.company_name AS supplier_name
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 sk.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)

Did you find this article helpful?