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
"net use" shows a drive share as "unavailable" when run from the scheduler
URGENT: Need help parsing string for several numeric values SQL database columns
Restrict Textbox to Number and Decimal character only
image in datalist
Can Dell Poweredge 2950 run SBS 2008
Delete Access Query using ADOX
vbscript SQL Server 2005 calling SP
Mail-Merge Methods C#
Sumproduct fails when there it is there is 0
Excel + Access Integration - Passing Parameters