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 |
|
rajikrishna
Starting Member
12 Posts |
Posted - 2007-03-24 : 04:58:21
|
| I have 2 Tables PAD and INFO(as shown above). I need to update PAD based on its mapping with INFO. ie if ID of PAD matches with ID of INFO, update the PAD.ID with corresponding INFO.NUMBERI tried the below query but it was not successfullUPDATE PADE1SET PADE1.[Column 0] = (SELECT [Column 4] FROM INFO WHERE INFO.[Column 4] = PADE1.[Column 0]) |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-03-24 : 05:04:07
|
[code]UPDATE pSET ID = i.NUMBERFROM PAD p inner join INFO iON p.ID = i.ID[/code] KH |
 |
|
|
rajikrishna
Starting Member
12 Posts |
Posted - 2007-03-24 : 05:05:21
|
| I shall give the columns of both my tables for better understandingTable PAD has the column IDPADaaabbbccefghTable INFO has the columns ID,NumberID Numbera 1b 2c 3My Result should beTable PADID 11122233efgh |
 |
|
|
rajikrishna
Starting Member
12 Posts |
Posted - 2007-03-24 : 05:08:54
|
| Thanks a ton! Khtan |
 |
|
|
|
|
|