Hi,
I need a help in case statement.
I want to know whether we can set value for two fields in case statement
for example
Select
(CASE
WHEN SUnits> 0
THEN 'xxx'
WHEN RUnits > 0
THEN 'yyy'
END)
Here I need to set another value as well in Then statement
I want the above to be like this
Select @data=
(CASE
WHEN SUnits> 0
THEN 'xxx' ,@dsr=1
WHEN RUnits > 0
THEN 'yyy', ,@dsr=0
END)
Is it possible?
Else the below statement is the only way
Select @data=
(CASE
WHEN SUnits> 0
THEN 'xxx'
WHEN RUnits > 0
THEN 'yyy',
END),
@dsr= (CASE
WHEN SUnits> 0
THEN 1
WHEN RUnits > 0
THEN 0
END)
Here I need to