263: end
264: from cn_srp_plan_assigns_all pln
265: where srp_plan_assign_id =
266: (select srp_plan_assign_id
267: from cn_srp_period_quotas_all
268: where salesrep_id = pmt.credited_salesrep_id
269: and period_id = pmt.pay_period_id
270: and quota_id = pmt.quota_id
271: and org_id = pmt.org_id