|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Combine update stmts into one
How I can combine these two update statement. I tried using a If Else but I received the following error:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression. Update Revenue set Difference_Flag = 'Yellow' From Revenue where ((TY_Revenue - LY_Revenue)/LY_Revenue)*100 = 0 go Update Revenue set Difference_Flag = 'Yellow' From Revenue where ((TY_Revenue - LY_Revenue)/LY_Revenue)*100 = 0 go |
|
#2
|
|||
|
|||
|
Hi,
I don't see the difference between the 2 statements (perhaps I've been staring at the screen too long! so I don't understand what you mean by "combine", as they are the same???Also, You don't need the "From Revenue" in the code Update Revenue set Difference_Flag = 'Yellow' where ((TY_Revenue - LY_Revenue)/LY_Revenue)*100 = 0 go |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Combine update stmts into one |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|