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 |
|
Mondeo
Constraint Violating Yak Guru
287 Posts |
Posted - 2008-05-20 : 06:42:49
|
| Table 1VehicleRef Term Mileage Price12000 3 10000 212.1212001 3 10000 215.1212002 3 10000 217.1212003 3 10000 220.20Table 2VehicleRef Term Mileage Price12000 2 10000 121.1212000 2 20000 123.12 12000 2 30000 145.12 12000 3 10000 145.1212000 3 20000 145.12 12000 3 30000 146.45I want to update the price on table 1 with the price from table2 where the vehicleref,term,mileage are the same in table1 and table 2Thanks |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-05-20 : 06:46:10
|
Don't you know this even after over 100 posts?Update t1set Price = t2.PriceFrom Table1 t1 join Table2 t2on t1.VehicleRef = t2.VehicleRefand t1.Term = t2.Termand t1.Mileage = t2.Mileage Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|
|