Re: [GENERAL] SELECT only those values of table B which have a value in table A

2010-02-25 Thread Stefan Schwarzer
SELECT COALESCE(r.name, ) AS name, d.year_start AS year, SUM(d.value * d_nom.value) / SUM(d_nom.value) AS value FROM pop_total_access_water AS d RI

Re: [GENERAL] SELECT only those values of table B which have a value in table A

2010-02-25 Thread Michal Politowski
On Thu, 25 Feb 2010 09:34:19 +0100, Stefan Schwarzer wrote: > Hi there, > > I have tables with values for each country of the world. > > Now, there is the possibility for the user to generate regional > (Europe, Africa...) or subregional (Western Europe, Central > Europe...) aggregations on-the-f

[GENERAL] SELECT only those values of table B which have a value in table A

2010-02-25 Thread Stefan Schwarzer
Hi there, I have tables with values for each country of the world. Now, there is the possibility for the user to generate regional (Europe, Africa...) or subregional (Western Europe, Central Europe...) aggregations on-the-fly. In some cases, these aggregations need to be calculated by usin