select distinct opr.operatorId, opr.companyName, opr.territoryId, spl.createDate from tbl_SPL_Opportunities spl inner join tbl_OPR_ClientOperators opr on opr.operatorId = spl.partnerId where spl.campaignId = and spl.partnerType = 'OPR' and spl.ownerId = 26 and not exists ( select * from tbl_CRM_Participants p where p.marketingActivityId = and p.operatorId = spl.partnerId ) select i.interactionId from tbl_CRM_interactions i inner join tbl_SPL_Opportunities spl on spl.opportunityId = i.sourceId and spl.ownerId = i.ownerId and spl.ownerType = i.ownerType and spl.partnerId = i.partnerId and spl.partnertype = i.partnerType where i.sourceType = 'SPL' and i.ownerId = 26 and spl.campaignId =