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
How can I put the file name and a SHORT path at the bottom of my word 2007 documents?
How can I programmatically get a list of spreadsheets from a MS Excel workbook?
CommonDialog control in Access 2007 -- problem
VBA Looping through cells
Install Office Small Business 2007 using .msi file
Installation of BackupExec 10
How do I replace #N/A if it is returned in a formula? (not Vlookup)
Find Pivot Table's Name
SQL command not properly ended
Try to open a Silverlight project on Visual Studio 2008 but I can't