ID Status OfferID
1 Processed 456
1 Processed 123
2 Pending 999
3 Processed 678
3 Pending 789
Based on ID,
- if ID=1 and having same status then output column(CTSDate) should be max of offerID
- IF ID=2 and having only one status then output is offerID associated with it
- If ID=3 and having different Status then pick Processed status related OfferID
The above scenario need to be worked for a wholeset of data.
Please help.