No Longer Supported
delete from tbl_LST_partnerListItems
where listId = 142638;
insert into tbl_LST_PartnerListItems ( listId, partnerId )
select 142638 listId, operatorId as partnerId
from tbl_OPR_CLientOperators
where operatorId in (
select operatorId
from tbl_TPM_ProofOfDelivery
where ownerId = 1
and ownerType = 'MFR'
and claimId in ( select claimId from tbl_TPM_Claims where claimType = 'D' and ownerId = 1 and ownerType = 'MFR' and year( claimPeriodEnd ) >= 2018 )
)
and ownerId = 1 and fsltablecode = 'MFR'
and nullif( fsl_choId, 0 ) is null;
Updated