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 |
|
s2002
Starting Member
49 Posts |
Posted - 2008-09-25 : 10:19:13
|
| hi, I have there are 2 table with the same structure on my db.table1 ID(PK) Count(integer)table2 ID(PK) Count(integer)there is not any relation between these 2 tables. Now I want to update "Count" field records in table2 and set their value the same value of "count" field recordson table1 "where table2.ID=table1.ID"I have think about something like thisUPDATE table2SET table2.count = table1.countwhere table2.ID=table1.ID |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-09-25 : 10:26:03
|
| UPDATE t2SET t2.count = t1.countfrom table2 as t2 inner join table1 as t1on t2.ID=t1.IDMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|