I am getting multiple values from my query.
select l_t_id from MLTalukDetails join MLDistrictDetails on MLTalukDetails.L_D_Id=4
It returns 13,14,15,16. Now I want to take each of these values at a time and get the details from those values i.e.
select Sc_Id from MSchoolDetails
where
MSchoolDetails.L_T_Id=@talukid and
MSchoolDetails.Y_Id=@yearid
What can i do this scenario. How can I use the for loop syntax here?
I’m inferring from your question that this is the complete solution you’re actually looking for:
Normally one has a join condition which involves both tables.
I’d suggest reading up on the various joins.