select opr.companyName, opr.focusAccount, mt.* from tbl_OPR_ClientOperators opr inner join #matrixTableName# mt on mt.partnerId = opr.operatorId and mt.ownerId = opr.ownerId and mt.ownerType = opr.fsltablecode where opr.territoryId in ( ) select fp.*, f.filterlabel, o.attrDescription from tbl_MFR_FocusProducts fp inner join tbl_CMM_Filters f on f.filterId = fp.mktCategoryId and f.ownerId = fp.ownerId and f.fsl_tablecode = fp.ownerType inner join tbl_ORG_Attributes o on o.attrid = fp.mktSubCategoryId and o.ownerId = fp.ownerId and o.fsl_tablecode = fp.ownerType where fp.ownerId = and fp.ownerType = #trim(xmlformat(attrDescription))# #trim(xmlformat(filterLabel))# #trim(xmlformat(companyName))# Current Customer Opportunity No Application Unknown