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 |
|
t1g312
Posting Yak Master
148 Posts |
Posted - 2004-12-26 : 05:18:29
|
| Hi all,Can I write a query to update fields in a row using values from another row in the same table?ThanksAdi-------------------------/me sux @sql server |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-12-26 : 05:50:30
|
Yes. Something like:UPDATE USET U.MyColumn = X.SomeColumnFROM MyTable U JOIN MyTable X ON U.AColumn = X.AnotherCoumn AND U.ABC = X.XYZ Kristen |
 |
|
|
t1g312
Posting Yak Master
148 Posts |
Posted - 2004-12-26 : 06:12:13
|
quote: Originally posted by Kristen Yes. Something like:UPDATE USET U.MyColumn = X.SomeColumnFROM MyTable U JOIN MyTable X ON U.AColumn = X.AnotherCoumn AND U.ABC = X.XYZ Kristen
Thanks Kristen!Adi-------------------------/me sux @sql server |
 |
|
|
|
|
|