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 |
|
syno
Starting Member
6 Posts |
Posted - 2008-07-20 : 06:08:33
|
| Hello GuysI am new to these forums and I need some help writing some SQL. Basically I want to update column 1 in table 1 where the values in table 1, columns 2, 3, and 4 and table 2, columns 2, 3 and 4 are the same.Thank you |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-20 : 06:45:03
|
[code]update t1set col1 = <some value>from table t1 inner join tablet2 t2 on t1.col2 = t2.col2 and t1.col3 = t2.col3 and t1.col4 = t2.col4[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
VGuyz
Posting Yak Master
121 Posts |
Posted - 2008-07-21 : 10:23:34
|
| Do you have any primary and foreign key relation ship for these two tables |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-21 : 10:28:23
|
quote: Originally posted by VGuyz Do you have any primary and foreign key relation ship for these two tables
OP has specified clearly the relationship b/w the tables in his initial post. |
 |
|
|
|
|
|