i have this query
SELECT dcp.discount_campaign_id, CASE WHEN dcp.active = 0 THEN dcp.product_id ELSE (pc.category_id where c.sku_code is NOT NULL) E