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 |
|
Vaishu
Posting Yak Master
178 Posts |
Posted - 2007-11-22 : 09:37:15
|
| HiI have table1 with tow columns ( col1 and col2)table2 colums (col1 and col2)Table1 -- col1--- col2 -----------A ---- dfg -----------B ---- ghtTable2-- Col1--- col2 -----------A ----- jjk -----------B ----- lklHow do I update col2 of Table1 with the data from col2 of Table2 in a Single Query |
|
|
suresha_b
Yak Posting Veteran
82 Posts |
Posted - 2007-11-22 : 09:49:02
|
| update t1set col2 = t2.Col2from Table1 t1inner join Table2 t2on t2.col1 = t1.col1 |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-11-22 : 09:49:24
|
| [code]Update t1set Col2=t2.Col2From Table1 t1 join Table2 t2 on t1.Col1 = t2.Col1[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
Vaishu
Posting Yak Master
178 Posts |
Posted - 2007-11-22 : 09:55:06
|
| Thank you very much for swift replies. |
 |
|
|
|
|
|