Conditional value copying in columns
Posted on 2005-04-27
I've created a temp table where one of the columns (Col. A) has a positive or negative value. I want to copy all the positive values in (Col. B) and the negative values in (Col. C) in the same temp table.
A B C
How will I update columns B and C.
when #temp1.A is positive then set #temp1.B = #temp1.A
set #temp1.C = #temp1.A
This is in plain english.. how would you write this in a code, saying for the positive or negative numbers?