• Add an extra join condition so you only get a single occurrence:

    ...

    INNER JOIN (SELECT ConsumerID, ConsumerAccountID

    FROM Consumer

    WHERE ConsumerType = 'S') s ON p.ConsumerAccountID = s.ConsumerAccountID

    AND p.ConsumerID < s.ConsumerID

    Edit: Moved AND condition to separate line to make it easier to see in code window.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.