select distinct opr.operatorId from tbl_OPR_ClientOperators opr with (nolock) left outer join tbl_OPR_DistributionDetails dd with (nolock) on dd.ownerId = opr.ownerId and dd.ownerType = opr.fsltablecode and dd.operatorId = opr.operatorId left outer join tbl_CDR_Distributors cdr with (nolock) on cdr.ownerId = dd.ownerId and cdr.fsl_tablecode = dd.ownerType and cdr.cdr_recordId = dd.cdr_recordId and cdr.crmActive = 'Y' inner join tbl_DST_Distributors dst on dst.dstId = cdr.fsl_dstId left outer join tbl_OPR_ClientOperators dstOpr with (nolock) on dstOpr.ownerId = dst.dstparentco and dstOpr.fsltablecode = 'DST' and dstOpr.mfrCustNum = dd.accountNumber and nullif( dstOpr.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 dstOprQ with (nolock) on dstOprQ.operatorOwnerId = dstOpr.ownerId and dstOprQ.operatorOwnerType = dstOpr.fsltablecode and dstOprQ.operatorId = dstOpr.operatorId where opr.ownerId = and opr.fsltablecode = and nullif( opr.fsl_choId, 0 ) is null and opr.crmActive = 'Y' and nullif( dd.accountNumber, '' ) is not null