Question : Put Two Case conditions in same select statement - SQL Server 2005

Hello Experts,

I have a stored procedure with a select statement which contains a CASE condition  like this:
SELECT   A, B, C, "D" = CASE
WHEN Condition
Then 'some value'
WHEN Condition
Then 'another value'
--etc
From Table1

Question - Is it possible to add another CASE condition like this:

SELECT   A, B, C, "D" = CASE
WHEN Condition
Then 'some value'
WHEN Condition
Then 'another value'
--etc
, "E" = CASE
WHEN Condition
Then 'some value'
WHEN Condition
Then 'another value'
--etc
From Table1

I tried this but I get a syntax error near the ,

Does anyone know how to do this??

Thanks!

From Table1

Answer : Put Two Case conditions in same select statement - SQL Server 2005

SELECT   A, B, C, "D" = CASE
WHEN Condition
Then 'some value'
WHEN Condition
Then 'another value'
END,
E =
CASE
WHEN Condition
Then 'some value'
WHEN Condition
Then 'another value'
END
From Table1
Random Solutions  
 
programming4us programming4us