Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ddombadoh
Starting Member
7 Posts |
Posted - 2013-02-28 : 06:11:45
|
Hello All,I have a little challenge.I am confronted with a situation where I need a stored procedure that will initially select a group of records by passing some parameters. I am expecting at least three records every time. Now, with the selected records, I want to iterate through them, pick a particular field each time and pass it as a parameter in a different select statement. Then return all the selected results from this iteration.Any help on this will be appreciated.Thanks |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-02-28 : 06:17:51
|
you dont need a loopjust do likeSELECT fieldsFROM secondTableWHERE Searchfield IN (SELECT LookupField FROM firsttable WHERE your filter conditions... ) ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|