I have a select query which returns 50 results. The select query returns id .
The next part i need to run a select query which value for all the 50 ids.
Please can some one tell me what is the best way to get it done. is using a for loop a good idea e.g.
begin
declare @count= select id from table1
for 1 to @count ..loop
select value from table2 where id =1
end loop
Can i use cursors what is the best method.