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 |
|
nasty84
Starting Member
6 Posts |
Posted - 2010-03-10 : 14:47:41
|
| Table 1ID ChildID GroupID101 201 ?102 201 ?103 201 ?Table 2ChilID GroupID RANK 201 300 1201 301 2201 302 3I nned to populate the groupID in table 1 with rank from table 2.I.eID ChildID GroupID101 201 300102 201 301103 201 302The lesser the rank goes to first ID of Table1.....second groupid goes to second id of table 1 as rank is 2 in table 2 and so on.How can i acheive this? Thanks for your help and time.. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-03-10 : 17:42:52
|
quote: I nned to populate the groupID in table 1 with rank from table 2.I.eID ChildID GroupID101 201 300102 201 301103 201 302
Update with column GroupID or Rank from Table 2. The required result shown 300 - 302 is the GroupID of Table 2 KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
avijit_mca
Posting Yak Master
109 Posts |
Posted - 2010-03-11 : 00:17:41
|
| Hi,update Table_1 set groupid = (select groupid from Table_2 b where b.id = Table_1.id )Regards,avijit |
 |
|
|
|
|
|