Du kan göra detta enkelt med en aggregatfunktion och en CASE
uttalande:
select year,
sum(case when place = 'U.S.' then price else 0 end) "U.S.",
sum(case when place = 'U.K.' then price else 0 end) "U.K."
from yourtable
group by year
Du kan göra detta enkelt med en aggregatfunktion och en CASE
uttalande:
select year,
sum(case when place = 'U.S.' then price else 0 end) "U.S.",
sum(case when place = 'U.K.' then price else 0 end) "U.K."
from yourtable
group by year