• SELECT DISTINCT product_id

    FROM fact_sales

    WHERE (agent_id=1 AND product_code in (1))

    OR (agent_id=2 AND product_code in (3))

    OR (agent_id=3 AND product_code in (2))

    OR (agent_id=4 AND product_code in (1))

    AND & OR operators

    http://www.w3schools.com/sql/sql_and_or.asp