The table project contains
projectid|description|statuscode|path|....
I have a SQL clause which should return the following (pseudocode):
SELECT ...,
CASE
WHEN statusCode IN ('C', 'N', 'F')
IF (path contains 'CLOSED PROJECTS')
THEN
REPLACE(path,'CLOSED PROJECTS','DEAD PROJECTS')
ELSE
REPLACE(path,'ACTIVE PROJECTS','DEAD PROJECTS')
,
.....
from Project where projectId=.....
How do I implement this 'conditional' REPLACE?
I am using SQL Server 2008.