I am having a bit of a problem with implementing a nested statement that will update based on conditions. I know the logic behind it, but do not know how to implement it with nested queries. Please see below the pseudo code I've written along with an example of what I want to do.
IN TABLE #NAME# IF COLUMN A IS NOT EQUAL TO COLUMN B SET COLUMN C AS 'TRUE' IF COLUMN D IS NOT EQUAL TO COLUMN E SET COLUMN F AS 'TRUE' ELSE SET AS NULL
What I want to do is something along these things but in one query instead of multiple
UPDATE tmpDifferences SET Diff1 = '*' WHERE bTerm <> aTerm UPDATE tmpDifferences SET Diff2 = '*' WHERE bDefinition <> aDefinition
But I want to do it in a nested fashion along the lines of
UPDATE tmpDifferences ((SET Diff1='*' WHERE bTerm <> aTerm) SET Diff2='*' WHERE bDefinition <> aDefinition)
I don't know if this makes sense to anyone or not but if you need further clarification please let me know. It's frustrating when you know the logic but can't write the code to satisfy it.
Thanks in advance guys! :)