select cdr_recordId
from tbl_CDR_Distributors
where ownerId =
and fsl_tablecode =
and cdr_territoryId in ( )
and crmActive = 'Y'
and cdr_dstCompanyType = 'G'
select a.partnerId
from tbl_CRM_Affiliations a
inner join tbl_CDR_Distributors cdr
on cdr.cdr_recordId = a.partnerId
and cdr.cdr_territoryId in ( )
where a.affiliationType = 'BYG'
and a.ownerId =
and a.ownerType =
and a.orgId in ( )
and a.orgType = 'CDR'
and a.partnerType = 'CDR'
select cdr_recordId
from tbl_CDR_Distributors
where ownerId =
and fsl_tablecode =
and cdr_territoryId in ( )
and crmActive = 'Y'
and cdr_dstCompanyType = 'P'
select cdr.cdr_recordId
from tbl_CDR_Distributors cdr
inner join tbl_DST_Distributors cdrdst
on cdrdst.dstid = cdr.fsl_dstid
inner join tbl_DST_Distributors pdst
on pdst.dstId = cdrdst.dstparentco
inner join tbl_CDR_Distributors pcdr
on pcdr.fsl_dstid = pdst.dstid
and pcdr.ownerId = cdr.ownerId
and pcdr.fsl_tablecode = cdr.fsl_tablecode
where cdr.cdr_territoryId in ( )
and pcdr.ownerId =
and pcdr.fsl_tablecode =
and pcdr.cdr_recordId in ( )
#whatsNewHTML#