Can I override a value in a column such that if a case is true, it tells value x to be equal to another dynamic value in the query. Here’s pseudocode. I know this doesn’t work.
Select jobTitle, managerTitle, bigBossTitle,
CASE WHEN jobtitle like '%DEVELOP%' THEN managerTitle = bigBossTitle
END
From PeopleTable
inner join... other tables...
Thanks.
Try this:
You just put the case statement where the managerTitle column was and then alias the result as managerTitle. This logic effectively gives you what you’re looking for. To actually “replace” a value you would need to do more advanced T-SQL and it’s not really necessary.
Example of using a case statement in a join predicate: