Hi All, I am having trouble with a certain query - being the only SQL resource in my company, I do not have anyone to confirm or deny my logic...I have three columns containing Id's (Account, Opportunity and Campaign). The requirement is to map all three columns to one based on certain logic. The logic. 1. If Account, Campaign and Opportunity are not null, then Opportunity.2. If Campaign and Account are not null, but Opportunity is null then Campaign.3. If Opportunity and Account are not null, but Campaign is null then Opportunity.4. If Opportunity and Campaign are not null, but Account is null, then Opportunity.I have written a nested case statement in that order, with the final else statement being NULL. The problem which I am having is that the majority of the values are NULL in the column to be updated.Do I need to specify all the above logic and is a nested case statement the best approach?Thanks in advance for your help.Cheers,Chris
↧