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 |
doggi3
Yak Posting Veteran
62 Posts |
Posted - 2004-09-14 : 06:06:35
|
Hi, I will like some advise on update query.I have Column_A and Column_B in Table_1. I will like to append data from Column_A to Column_B.From Column_A | Column_B A | BToColumn_A | Column_B | B AIn the result, Column_A becomes null.I wrote a query like this:Update Column_B + Column_AFrom Table_1Where Column_A <> ""There is error with the query and I am sure the first sentence is wrong. However, I do not know how to append the data from the Column_A to Column_B.Can any kind-hearted help? Thank you!- HELP - |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2004-09-14 : 06:23:10
|
Update Table_1set Column_B = Column_B + Column_AWhere Column_A is not nullSomething like that maybe?? Although Column_A will still have the original value in... |
|
|
doggi3
Yak Posting Veteran
62 Posts |
Posted - 2004-09-14 : 06:24:51
|
Thank you so much! Can I set Column_A to null at the same time, in a single query? Or do I write another query?- HELP - |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2004-09-14 : 06:38:13
|
You can do it in a single query...Update Table_1set Column_B = Column_B + Column_A, Column_A = nullWhere Column_A is not null |
|
|
doggi3
Yak Posting Veteran
62 Posts |
Posted - 2004-09-14 : 10:54:07
|
Thank You So Much~ ^-^- HELP - |
|
|
|
|
|