Skip to content
Advertisement

Mapping two columns into one column in Athena

I have data in the Athena something like this:

However, the table owner changed the provider to provider_new. Thus, after 2020-08-01 the provider returns to NULL. Here is my query:

How can I map these two columns to one?

Thanks in advance.

Advertisement

Answer

Do you want coalesce()?

coalesce() returns the first non-null value of the arguments it is given.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement