I have a query which returns few records. The Query result has a column 'ACCTID'. Now for each record i need to take the ACCTID and fetch record from other table. I tried it to do in C# but using loop, but it is taking lot of time. Pls suggest me how to do the same in SQL server side.
Overview of query is like below:
Main query:
Select NAME, CANCEL_DATE..., ACCTID from Table1;
What i need to do for ACCTID now is fetch data from two other tables for ACCTID fetched from above main query
:
select * from table2 where ACCTID=@ACCTID
select * from table3 where ACCTID=@ACCTID
In the end i need to return all the records fetched from above two queries.

Sreekanth ReddyRank #726 · 3.2K reputationPosted Dec 23, 2018, 10:54 PM EST
nitin singh17 reputationPosted Dec 23, 2018, 11:11 PM EST
Hi Sreekanth,
Sreekanth ReddyRank #726 · 3.2K reputationPosted Dec 23, 2018, 11:23 PM EST
Jignesh KumarRank #91 · 22.9K reputationPosted Dec 24, 2018, 4:19 AM EST
Kalyan Kondapuram98 reputationPosted Dec 25, 2018, 11:32 PM EST