Microsoft
Software
Hardware
Network
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
Help with OnTime Event
User is still recieving email for an email address that was removed from their account and applied to another
Access Web front-End
How do I convert double to string?
Append string from editbox to text file
EM_FORMATRANGE gives insufficient memory when printing with PCL 6
how to run a batch file from an asp.net 2.0 web page?
How to open outlook .ost file
How to import Excel worksheet to DataGridView keeping cell colors
Excel 207 question - formula