Last active
August 29, 2015 14:00
-
-
Save gmacdougall/ed03a0340ae79b3470ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT COUNT(*) | |
FROM "spree_products" | |
LEFT OUTER JOIN "spree_variants" ON "spree_variants"."product_id" = "spree_products"."id" AND "spree_variants"."deleted_at" IS NULL | |
WHERE "spree_products"."deleted_at" IS NULL | |
AND spree_variants.id NOT IN (SELECT variant_id FROM spree_well_amy_variant_lifestyles WHERE "lifestyle_id" IN (1, 2, 3, 4)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment