Untitled

 avatar
user_2590055
plain_text
a year ago
683 B
3
Indexable
Never
###5
#6

select 
	avg(case when t.year = 2006 and e.name = "PRCP" then o.value end)
    - avg(case when t.year = 2021 and e.name = "PRCP" then o.value end) as inc_PCRP,
    max(case when t.year = 2006 and e.name = "TMAX"then o.value end) 
    - max(case when t.year = 2021 and e.name = "TMAX" then o.value end) as inc_TMAX,
	min(case when t.year = 2006 and e.name = "TMIN" then o.value end) 
    - min(case when t.year = 2021 and e.name = "TMIN" then o.value end) as inc_TMIN
		from factobservation as o
		join dimelement as e on o.element_id = e.id
		join dimstation as s on o.station_id = s.id
		join dimtime as t on o.time_id = t.date_id
			where s.country_name = "United Kingdom"