Skip to content

Instantly share code, notes, and snippets.

@GreatPotato
Created April 12, 2013 13:49
Show Gist options
  • Save GreatPotato/5372137 to your computer and use it in GitHub Desktop.
Save GreatPotato/5372137 to your computer and use it in GitHub Desktop.
Get LemonStand products which have never been sold
SELECT t2.id, t2.sku, t2.name, t2.price
FROM shop_products t2
WHERE NOT EXISTS (SELECT * FROM shop_order_items t1 WHERE t1.shop_product_id=t2.id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment