Skip to content

Redshift – Is there a way to merge rows based on a common column

I have a table like this

Is there a way to do this in a single query, or would I need to create a CTE for each different channel and then create a join?

Thanks in advance for all your help! I am trying to create a query that will let me merge the rows into a single row based on the node_id, something like below

Advertisement

Answer

You can do conditional aggregation:

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