On Mon, 3 Jun 2002 10:00:28 +0200, Andre Schubert
<andre(dot)schubert(at)km3(dot)de> wrote:
>I tried this, but it update always one row in foo.
>
>update foo set inet=sum(bar.inet),local=sum(bar.local) where foo.ip = bar.ip;
Andre,
this worked in my test:
UPDATE foo
SET inet=b.i, local=b.l
FROM (SELECT ip, sum(inet) AS i, sum(local) AS l
FROM bar
GROUP BY ip) b
WHERE foo.ip = b.ip;
Servus
Manfred