select cm.customernumberid, cp2.* from Boss_dev..contractproduct cp (nolock) join Boss_dev..contractproductcustomernumber cpcm (nolock) on cpcm.contractproductid = cp.contractproductid join Boss_dev..customernumber cm (nolock) on cm.customernumberid = cpcm.customernumberid join contractproduct cp2(nolock) on cp2.contractproductid = cp.contractproductid where 1 = 1 and cp.productid = 11001 and cp.contractproductstatusid = 1012 and cp.activationdate is not null and cp.deactivationdate is null and cp.supplierid = 200005