luvmy2kids
MIS
I have the below query:
Select x.intid, x.fieldid, x.extid, custid, name
from ss_hcsscsa.dbo.custcustomer mstr
LEFT OUTER JOIN integrateprod.dbo.intxref x on mstr.custid = x.extid and x.subscriberid = 2 and x.fieldid = 95
where name in (select * from ss_hcsscsa.dbo.top50clients)
group by custid, name, x.intid, x.fieldid, x.extid
I added this part: where name in (select * from ss_hcsscsa.dbo.top50clients)
because the same custid may be used in different databases, so what I want to get is only pulled those customers who are in my "top50clients" table.
Adding that line gives this error:
insert into #custtdata (intid, fieldid, extid, custid, name)
Please advise!
Thanks a bunch....
Select x.intid, x.fieldid, x.extid, custid, name
from ss_hcsscsa.dbo.custcustomer mstr
LEFT OUTER JOIN integrateprod.dbo.intxref x on mstr.custid = x.extid and x.subscriberid = 2 and x.fieldid = 95
where name in (select * from ss_hcsscsa.dbo.top50clients)
group by custid, name, x.intid, x.fieldid, x.extid
I added this part: where name in (select * from ss_hcsscsa.dbo.top50clients)
because the same custid may be used in different databases, so what I want to get is only pulled those customers who are in my "top50clients" table.
Adding that line gives this error:
insert into #custtdata (intid, fieldid, extid, custid, name)
Please advise!
Thanks a bunch....