-1

for each row I need to select highest value from 3 columns, somethings like below. However, for some reason I can't do this. Please help.

SELECT 
SubscriberKey,
MAX(VALUE(Clicks_Syria), 
VALUE(Clicks_Ukraine), 
VALUE(Clicks_Afghanistan))
FROM Total_Clicks_Summary_V2_Copy
1
  • 2
    What error or result do you get? Jan 26, 2023 at 11:36

1 Answer 1

1

Try this:

SELECT 
SubscriberKey,
MAX(Clicks_Syria) as syria, 
MAX(Clicks_Ukraine) as ukraine, 
MAX(Clicks_Afghanistan) as afghanistan
FROM Total_Clicks_Summary_V2_Copy
GROUP BY SubscriberKey

Not the answer you're looking for? Browse other questions tagged .