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)); |