select distinct opr.operatorId from tbl_OPR_ClientOperators opr with (nolock) left outer join tbl_CRM_Affiliations aff with (nolock) on aff.ownerId = opr.ownerId and aff.ownerType = opr.fsltablecode and aff.partnerId = opr.operatorId and aff.partnerType = 'OPR' left outer join tbl_OPR_ClientOperators cho with (nolock) on cho.ownerId = opr.ownerId and cho.fsltablecode = opr.fsltablecode and cho.operatorId = aff.orgId and cho.crmActive = 'Y' left outer join tbl_OPR_ClientOperators choOpr with (nolock) on choOpr.ownerId = cho.fsl_choId and choOpr.fsltablecode = 'CHO' and choOpr.mfrCustNum = aff.partnerAffiliateNbr and nullif( choOpr.mfrCustNum, '' ) is not null left outer join tbl_1FS_MappingQueue oprQ with (nolock) on oprQ.operatorOwnerId = opr.ownerId and oprQ.operatorOwnerType = opr.fsltablecode and oprQ.operatorId = opr.operatorId left outer join tbl_1FS_MappingQueue choOprQ with (nolock) on choOprQ.operatorOwnerId = choOpr.ownerId and choOprQ.operatorOwnerType = choOpr.fsltablecode and choOprQ.operatorId = choOpr.operatorId where opr.ownerId = and opr.fsltablecode = and nullif( opr.fsl_choId, 0 ) is null and opr.crmActive = 'Y' and nullif( aff.partnerAffiliateNbr, '' ) is not null and nullif( choOpr.operatorId, '' ) is not null and nullif( choOpr.fsl_choId, '' ) is not null