How can i write a case statement for the following scenario. Please guide me or give an idea
We need to populate Activity_info column.
For populating the column, we need to consider few things which i am mentioning in here.
First Search for the values 'Paid search click' , 'Banner ad click' , "Email click' in the Activity column
Lets say For the Corresponding recording for "Paid search click" We have the Entry_id value as 1711 ; We need to search for that particular value "1711" in the entire column.
In the above we have 2 cases of same Log_Entry_ID with value "1711" but we need to look for only "CAMP" value that exists in the ACT_CD for one of the 1711 value and get the corresponding value from ACT_TXT (in here we have "Search") and needs to populate it into Activity_info column for that related record.
That means Activity_info should be equal to ACT_TXT WHERE we need to satisfy the above condition.
Same is the case with "Banner AD Click" the value is 1752 for Entry_ID as we have two same values for entry_id we need to look For Selected_Activity_CD = "CAMP", Activity Info will be Selected_Activity_Tx ..in here it is "s3k265"
In the above 2 cases of same Log_Entry_ID, when Activity is in either of Banner Ad Click, Paid Search Click or Email Click
For Selected_Activity_CD = "CAMP", Activity Info will be Selected_Activity_Tx
How can i write a case statement. ?
Please guide me.