Skip to content
Advertisement

get aggregation values by other values in sql

I have two tables that looks like this in their schema :

What I’m looking for is to create a table that looks like this :

I have tried this query :

but it gives me the following error saying Subquery returns more than 1 row

Advertisement

Answer

You can use conditional aggregation:

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