Aggregierte Hstore-Spalte in PostreSQL
Ich habe einen Tisch wie diesen:
Table "public.statistics"
id | integer | not null default nextval('statistics_id_seq'::regclass)
goals | hstore |
Artikel:
|id |goals |
|30059 |"3"=>"123" |
|27333 |"3"=>"200", "5"=>"10" |
Was muss ich tun, um alle Werte durch Eingabe von Hash zu aggregieren?
Ich möchte folgendes Ergebnis erhalten:
select sum(goals) from statistics
Rückkehr
|goals |
|"3"=>"323", "5"=>"10" |