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 |
|
sudha12345
Starting Member
47 Posts |
Posted - 2009-04-25 : 07:58:48
|
| I has two tables infusion,serverlist which has rows likeinfusionserverid cusomerid name age1101 1 we 251101 1 mm 321101 2 qs 281102 1 rd 351102 1 km 821102 1 rk 541102 2 kl 171102 3 rm 451103 1 rd 56serverlistserverid customerid1101 11101 21102 11102 21102 31103 1now i want the output thatthe first row of serverlist has to match with records of infusion and return those records that has matched and insert ino another table which like infusion.the second row of serverlist has to match with records of infusion and return those records that has matched and insert ino another table which like infusion.the third row of serverlist has to match with records of infusion and return those records that has matched and insert ino another table which like infusion.and so on till endnote that the records in serverlist are not fixed, there may be 3 or 4 or 5. its not fixedSudhakar |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-04-25 : 11:43:42
|
[code]insert into table_like_infusion(serverid,cusomerid,name,age)select i.serverid, i.cusomerid, i.name, i.agefrom (select distinct serverid from serverlist) sjoin infusion i on i.serverid = s.serverid[/code]Webfred No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|