select top 15 sku, skudesc, packsizedesc, skuid, mfr_name from tbl_BCRM_UserRecentInterest uri inner join tbl_prd_skus sku on sku.skuid = uri.subjectid and sku.ownerid = and sku.fsl_tablecode = inner join tblManufacturers mfr on mfr.mfr_id = sku.mfrid where uri.ownerid = and uri.ownertype = and uri.fspro_userid = and uri.subjecttype = 'sku' order by uri.createdate desc select top 15 operatorid as partnerid, 'OPR' as partnertype, companyname, address, address2, city, state, zipcode, uri.createdate from tbl_BCRM_UserRecentInterest uri inner join tbl_opr_clientoperators opr on opr.operatorid = uri.subjectid and opr.ownerid = and opr.fsltablecode = where uri.ownerid = and uri.ownertype = and uri.fspro_userid = and uri.subjecttype = 'opr' order by uri.createdate desc select top 15 cdr_recordid as partnerid, 'CDR' as partnertype, cdr_dstname as companyname, cdr_dstaddress1 as address, cdr_dstaddress2 as address2, cdr_dstcity as city, cdr_dststate as state, cdr_dstzip as zipcode, uri.createdate from tbl_BCRM_UserRecentInterest uri inner join tbl_cdr_distributors cdr on cdr.cdr_recordid = uri.subjectid and cdr.ownerid = and cdr.fsl_tablecode = where uri.ownerid = and uri.ownertype = and uri.fspro_userid = and uri.subjecttype = 'cdr' order by uri.createdate desc select * from qcf_recentOperators union select * from qcf_recentDistributors order by createdate desc